They only struggle to make a profit because of investments into their future, basically: training, aggressive hiring of AI researchers. Anthropic seems to have 90% margin on their API pricing and all enterprise customers have to use this.
And the reason they can do this is because they can create a $1Tr company in 5 years, so they know the investment will pay off.
Why Elon wants his own model so much is a good question with many possible answers, but if Cursor/xAI can produce a truly good model at competitive pricing I don't see why many people won't jump on it.