It depend what you are talking about.
If it’s for simply exploration of space, then it’s usually governmental programs that will pay for it through taxes. It doesn’t make money, the end goal is to explore space, collecting data, making scientific research, etc. This can be done by the Space Agency, or they could pay a company to provide the services to achieve their goal, in that case the company will make money because the government pay them to do it.
Then you have the military. They have things like GPS, communication and spy satellites. In that case, they will pay a company to build and send their equipment just like they would do with a tank or a fighter jet.
Finally, you have purely commercial stuff. Satellite are used in communication, weather forecasting, television signal, internet, etc. Many stuff we use everyday need satellites to work and so the company that provide that service had to pay a space company to build and send that satellite in orbit and then that service provider recuperate their cost by selling their service to consumer.
Latest Answers