Yep, and when the government doesn't properly tax those harm-to-public-good things like air pollution to balance the incentives and make it cheaper to do "the right thing" and pollute less, companies (which are made of real people and are not just unthinking machines) will do whatever they can to maximize profits. This is why it's so important to e.g. Increase the price of water to reflect the true cost in the Central Valley of CA instead of letting tons of farmers grow water-intensive crops in open-air, wasting tons of water just because it's cheap (then they complain about "is GROWING FOOD a waste of water?!?", completely un-ironically). Many businesses subsidize their operations using government funding, yet again ironically most of the rich white men running them are staunch opponents of public assistance programs despite owing most of their wealth to similar mechanisms, typically in conjunction with massive tax avoidance.
Pretty funny that the only reply here is 'found the Marxist' (maybe it was supposed to be a joke?) when, in reality, all you're suggesting is that the government set the conditions for the proper functioning of the market, which is an idea straight our of Hayek.