As the other two have said - City of Heroes was actually bringing in a profit per the development and maintenance costs. But NCSoft in all their wisdom and forethought decided to abruptly kill off the game. Even the developers didn’t have much warning.
It was, quite literally, “Yay, issue 24 is out, new stuff, new…