If it's cost > it's profit, why is it still used so widely?
Network effects, data lock-in, asynchronous information exchange in markets. Just because something is rationally better doesn't mean that the market actors are rational.
That said, companies like EA, Apple, and Amazon license Jive Forums (which is not cheap), Confluence, et al for a reason.
I recently replaced a C#/.NET app with a PHP version and saved a company close to a million a year in licensing, servers, staffing and development costs. Not to mention it took my team a third of the time to develop as the original application, yet performed better and had more functionality. There was a significant gap in LoC as well.
Your anecdote is a personal anecdote, coming from the person most likely to have a particularly jaded view of both the short and long-term costs involved.