Even in the real world the idea that "companies exist to make profit" sounds wrong. Companies exist to ideally output goods or services, and profit is a tool to ensure they can continue making those goods or services. It can be hard for a company to exist without making a profit, but not the reason they exist.
Perfect here refers to the mathematical model of a perfect market and perfect competition, not an external normative sense of the word as some societal ideal.