It's all about the context you put it in. If the PS3 was a financial failure, it certainly wasn't a commercial failure and this is reflected in the sales of the PS4 being stronger than ever. Despite losing money on each PS3 (and barely breaking even on each PS3 slim), Sony stood behind the PS3 and supported it (and still supports it) as best as they could. If Microsoft didn't screw up with their DRM policies, they could've taken the lead, but that's just one of the mistakes they did (with the other glaring mistake being the forced Kinect bundle at launch).
Nintendo is not losing money on Wii U. They have tons of cash from the previous generation thanks to the Wii. But despite that, Nintendo being in the optimal situation financially, they still produced a commercially failing console. Put it in that context, it's not about whether a company makes or loses money with their hardware. Everyone and their mother knows that software sells hardware. Sony knows that all too well, which is why PS4 is selling like hot cakes even though there's barely anything important to play on it. (It's the strong brand that comes with the promise of the great games we saw in the previous generation.) Nintendo on the other hand is relying on the Mario Kart 8 strategy, which is not a good strategy. Having a couple of high level titles releasing for the Wii U in a year with crappy releases in between only ensures that nobody is going to give a damn about the Wii U. Compare this to the 3DS, which not only is getting the high level titles in great amounts, but Nintendo also surprises us with strong releases in between (e.g. the new Fire Emblem game that nobody saw coming).
Just my 0,02 euros.