When that corporation is performing contracted work for the government, they act as the government's agent, making them subject to the same restrictions regarding civil rights as the government itself.
They're not operating on behalf of a local government if they're selling the public data of that local government to others. This is not a simple "contracted work" by a local government. Please don't normalize this as something it's not.