Our nearest neighbor is about 1/4 mile and the nearest with chickens is about 1/2 mile. I can hear their rooster at very early hours. Some people might not appreciate things like that.
Livestock and pets require management, and since for every responsible pet/livestock manager there are another 15 idiots, cities tend to outlaw them. They also do so because within city limits, required space to have livestock is limitied and they also have the authority to impose ordinances such as banning livestock. It's actually pretty simple to me.
If I opted to live in a cookie-cutter neighborhood in the city, I'd probably be a bit miffed by somebody's rooster crowing 15 feet from my bedroom window when I was trying to sleep. It's no different than hearing salsa music blasting until the wee hours of the night or hearing the next-door neighbor's pack of beagles howling to no end.