Speculations as to why pigs rather than cows form part of the character meaning home comes from some misunderstandings about the characters. Specifically,
「家」 contains 「豕」 as a corrupted phonetic component rather than a semantic component;
「牢」 did not originally contain 「宀」, which is a corruption of a drawing of an animal pen.
Shuōwén's explanation of 「家」 is very close, and it traced the source of the phonetic hint of the character correctly.
商
甲

甲207
合集20268
「家」 (Baxter-Sagart OC: /*kˤra/, home/dwelling) was originally comprised of semantic 「宀」 (building) and phonetic 「𢑓」 (also /*kˤra/). In the character 「家」, 「𢑓」 was very early on corrupted into 「豕」, leading on to the modern form.
商
甲

乙1047
合集13584西周
金

毛公鼎
集成2841秦
簡

法106
睡虎地秦簡今
楷

「𢑓」 (male pig) was originally a picture of a pig 「豕」 with an emphasised reproductive organ, and this word is now written as 「豭」. The glyph evolution compared with 「豕」 is as follows:
商
甲

京津1048
合集15346西周
金

頌鼎
集成2829
篆

彑部
說文解字
隸定

商
甲

佚43
合集20723西周
金

圅皇父簋
集成4141
篆

豕部
說文解字今
楷

Yes, Shuōwén is a source of some egregious graphical corruptions, and it simultaneously remains as one of the most important sources of modern character standardisation. It is a good starting point for character analysis that shouldn't at all be relied on.
Shuōwén's explanation,
“家,居也。从宀,豭省聲。”
「家」 means dwelling, and is comprised from semantic 「宀」 and abbreviated phonetic 「豭」.
correctly determined the vocabulary source of the phonetic hint, but did not correctly determine the actual character representing the vocabulary source.
The other explanations which interpret 「豕」 as a semantic hint are (in my opinion) rather far-fetched, although these explanations will pop up everywhere in more conservative accounts of the character. At the very least, the non-association of characters for non-pig animals with the character for the meaning home/dwelling strongly suggests the importance of the phonetic role of 「𢑓」.
Finally, 「牢」 did not originally contain 「宀」.
商
甲

摭續90
合集33631
The original character was a picture of an animal pen, and sometimes, 「羊」 (sheep), 「馬」 (horse), or 「牛」 (cow) was added to the character:
商
甲

乙1983
合集903商
甲

1.522
寧滬新獲甲商
甲

甲392
合集33314
The form with cow is the shape which has survived ...
西周
金

貉子卣
集成5409
... and the animal pen component was later corrupted into 「宀」 (building).
戰國・楚
簡

2.77
包山楚簡秦
簡

日甲65背
睡虎地秦簡今
楷

References: