This is doubly bad if you're displacing natural grasslands and grassland grazing with this. I.e. plant corn on your previous grasslands and cram the cows into some barn.
This came through HN just recently. Another way to do the same though is to go back to what the big buffalo herds were naturally doing. I.e. let your cows actually "trample and shit on the land" and that's what actually keeps it fertile. Then you harvest the cows for meat while keeping their number stable.
Win - win