Imagine there are two paths from A to B (the left and right path). 100 people walk from A to B. Half take the left and half the right, and none of them have any information not in this paragraph.
There are wolves on the left path. Everyone who travels it gets eaten. Now, at B, we have 50 people. They all chose the right path voluntarily, they all made a choice. None of them knew about the wolves though. How do we catagorise this situation in term of having and not having made a "real" choice? I argue that in practice, whatever the people were thinking when they chose B was irrelevant, because they didn't know the thing that actually mattered and they didn't have a proxy variable for it.
With that setup, I'd argue companies that "help collect a number of people with similar goals rather than to solely make a profit" are a lot like my right path, in that the people may not have been focused on maximising profits, but if they didn't achieve them they wouldn't have lasted long. By evolution, there will be a decided drift towards companies maximising profits even if all the individuals actually making the choices think they are doing something real (or I suppose, the converse where they think that their job is meaningless).
If anything, the drive for profit is a little less now.
This is one of the reasons among many I regard the decline in proper journalism as so worrying.
A corporation could be chartered for any reason. What is true is that in the early 19th century there was a legal pretense that corporations had to justify their charter to the government in order to be approved and renewed.
One of the very first corporations in USA was Alexander Hamilton's bank, that ran a water utility as a front operation. https://en.m.wikipedia.org/wiki/The_Manhattan_Company
The old days weren't as honorable as the stories whitewash.
But not-just-for-profit corporations have existed for a long time.
https://en.m.wikipedia.org/wiki/B_Corporation_(certification... is a modern trend.
You might want to have a look at an history book then. Companies had slaves, got kids working in mines, got to use the government to shout their workers who rebelled because they had no rights whatsoever, or just straight up used private armies. It was all pre 20th century already. If all this was not solely to make a profit, I don't know what it was.
Furthermore the great majority of big ventures were family driven. There were not formal associations between "people with similar goals" who weren't blood related.
Tactics, when it came to dealing with competition, were far beyond anything you see today. There were few regulations in the US, so companies were free to devise all manners of schemes to best their competitors. The treatment of labor in the pursuit of profit, was similarly far more brutal (there's really no comparison, Amazon's warehouse workers are treated like kings compared to sweatshop workers back then).