There are some private prisons, but overwhelmingly most are run by the state or federal government. However, that makes what you say even more true; they aren't driven by competitive market forces. Of course, many things aren't, and presumably that's the role of government regulations, to protect the public interests and fulfill the social contract. (Whether it does or doesn't is larger topic, and not something I'm trying to address in this comment)