They were not. Most people split Shakespeare's sonnets into three categories: the first sonnets are known as the Fair Youth sonnets (1-126). There are different theories about who this might be, but the first ones urge the subject of the poems to marry and have children; see Sonnet 12's final couplet for example:
And nothing ‘gainst Time’s scythe can make defence
Save breed, to brave him when he takes thee hence.
It has been suggested some of these sonnets might have been commissioned by a noble who wanted her son encouraged to marry and have kids, but this was mostly speculation from a college professor I had. There are also hints of homoeroticism, such as in Sonnet 20:
A woman’s face with nature’s own hand painted
Hast thou, the master-mistress of my passion
Sonnets 78-86 are sometimes known as the Rival Poet Sonnets, but again, these do not indicate them being written for his wife. They come across more as from a place of insecurity or jealousy, but are still categorized among the Fair Youth Sonnets by most.
Sonnets 127-152 are known as the Dark Lady Sonnets—it's, again, not known who these were written for, but they're not likely the kind of thing his wife, or any woman, would want written about them; in Sonnet 130, he describes her as having "black wires" for hair and states that her breath "reeks." He also refers to the Dark Lady as his "Mistress," indicating the sonnets are not about his wife.
There have been attempts to identify the Dark Lady, but I've never seen it suggested it was Anne Hathaway (his wife). Occasionally, Sonnets 153 and 154 are lumped in with the Dark Lady sonnets, sometimes they're given their own category as the Greek Sonnets.
Shakespeare's life is quite an enigma due to the lack of personal writings he left behind (though Russel Fraser's two-volume biography suggests some of these may have been inadvertently burned by someone, I believe for warmth), but it's mainly understood that his sonnets were not written about his wife—they were apart for most of his life, as well, due to him spending so much time in London while she remained in Stratford-upon-Avon.
Sources:
David Bevington, The Complete Shakespeare, Sixth Edition
Russell Fraser, Young Shakespeare, Shakespeare: The Later Years