It's likely because it's stupidly cheap.
A Flock camera is around $2000 installed - and installation is basically sticking a pole in the ground as the cameras are solar powered and use the cellular networks for communication. A neighbourhood HOA can install a bunch for very little cost, which is where they proliferated for a number of years. They were just cheap things to install and use, and many cameras are operated by private companies.
Even the contract the city has likely only cost $100K or less, and likely Flock has them on a service plan where they can install X cameras for that subscription fee. And I believe the police agencies are given access for free for any camera in their network - whether installed by a private company, or city/town/etc.
That's really why they've proliferated. And honestly, they probably would've stayed under the radar save for recent events which revealed less than savory law enforcement groups abusing their access to track people or certain peoples.
One trick that worked in WA state was someone simply filing a FOIA request - it was a properly formatted FOIA request that only requested images from a certain time and place. It went through the courts which decided they were public records, and since it was well formatted and requested and contained they should be turned over. The towns felt that brought up a bunch of questions regarding future FOIA requests and decided to shut down their network to avoid having to answer those questions.