Why companies choose to make zero economic profits in the long-term when it can maximize it instead?
Companies do not choose to make zero economic profits. In economics we start with assumption that companies want to maximize profits.
However, profit maximization in some market structures such as perfect competition or monopolistic competition leads to zero economic profit (see Mankiw Principles of Economics).
This is because in these market structures entry is free and competition is so cutthroat that best that profit maximizing firm can do is to have zero profit.
Why does Apple have large profit margins?
First, of all Apple is clearly not company operating under perfect competition, and one could argue it is not operating under monopolistic competition either since in the market for high end luxury phones there are only few competitions, and there might be implicit entry barriers so it could be argued oligopoly model is better fit for Apple.
In oligopoly entry barriers and less competition allows profit maximizing companies to get some economic profit.
However, this being said you seem to be confusing economic and accounting profit.
Accounting profit is what you find on profit and loss (income) statement of Apple. That is however not the real economic profit of a company. The economic profit is calculated by also subtracting opportunity cost that the company has.
For example, if Apple invests into its business 1 million USD to buy capital, and then they get 100000 USD profit, but the same 1 million USD could be invested into mutual fund with 10% return (yielding 100000USD), the economic profit of Apple would be zero.
The point is that accounting profit margins provide zero indication of how profitable the company is in economic terms.
This being said I am pretty sure that company such as Apple has lot of market power so they have genuine economic profit. However, even with (accounting) profit margin of 27% or even orders of magnitude higher you can’t just automatically say company actually earns economic profit. Company could have economic loss or just 0 economic profit even with large (accounting) profit margin. Whether company has economic profit or not has to be estimated by trying to estimate all implicit costs that accounting ignores, and also correcting for some things that are done in accounting for sake of simplicity (eg straight line depreciation) that do not reflect actual economic reality. In addition you would ideally correct for all shenanigans companies do to under or overreport their figures in accounting.