I don't think it's the confinement. Wolves which range hundreds of miles are kept in captivity by humans in small areas (dogs), and they live far longer with humans than in the wild.
I think it's the water quality. Dog poop and urine don't mix with the air, they don't breathe it in. Marine animals on the other hand, DO breathe their own feces. Which is why it's essential to have a large volume of water per animal, as happens in nature.
I have guppy fish in a 30 gallon tank. They almost never live past 2 years in captivity. In nature however, guppies live 5 years or more.
I've been thinking of doing an experiment for quite a while. Take two groups of guppies, one in a common aquarium environment, say 10 guppies in a 10 gallon tank (1 inch of fish per gallon). The other group would live in a far less dense tank, maybe 5 guppies in a 200 gallon tank. (5 would be the minimum number since guppies are communal fish and they don't do well mentally unless they're in a group). And compare the fish lifespan in the the 2 groups.