Companies don't want the largest market share unless it's a monopoly, they want the biggest profit. And being a premium vendor with a dedicated but smaller customer base is much safer and profitable (like Porsche) than having a great market share but being on the edge of going bust because your customers are cheapos (like Nokia).
You're right, making money is priority #1 for companies, but to generalize that profit margins are more important than market share is silly. I'm no economist, but I'd venture to say that it's balancing act market share, sales volume, and profit margins.
Since you brought up Porsche, I'll point out that it's a company that's teetered on the brink of financial collapse many times throughout it's history. Likewise, Ferrari is owned by Fiat. As for Lamborghini, Bugatti, and Rolls Royce, they're all owned by Volkswagen. Proud British marques like Jaguar and Land Rover are owned by Tata motors. So the only way these glamorous and super exclusive marques that subscribe to the low-volume, high-profit margin business model can stay in business is to tap into the coffers of parent companies that build pedestrian, low-profit margin products in very high volume. This doesn't even take into account the economies of scale factor, which lowers production costs and increases profit margins more than you might think even if you're selling a relatively inexpensive product.
In contrast, GM cleared roughly $135 billion in revenue, $7.6 billion of which was profit, in 2011. Ferrari, even with it's $200K-plus cars, can only dream of that kind of profit. That said, I'm not so sure that "being a premium vendor with a dedicated but smaller customer base is much safer and profitable," as you suggest