It happened anywhere from around 1920, to the 1980's, from what I have seen in my extensive bylaw research.
The more recent bylaws usually came about because there were irresponsible chicken owners who annoyed their neighbors so badly, that the neighbors went to their city halls and altered city bylaws. Chickens roaming loose, crowing roosters, and smelly, unclean, and unsightly coops were the most common annoyances.
Older bylaws outlawing city poultry seem to reflect a general feeling of city dwellers, that they left the country to get away from all of those smelly dirty animals and people. They had arisen above all that and didn't want to be associated with that image or those people anymore. That is just me reading between the lines, but I have read a lot of those old bylaws, and that is the impression that they give me. There is a bit of legitimate concern that people not keep poultry in their houses, and they shouldn't be butchering them willy-nilly in and around their houses, and manure management can be an issue, but health concerns didn't really seem to be at the heart of these old bylaws.