While the PlayStation 3 was in no way a failure, it nevertheless had a rough start. The Xbox 360 had a full year head start and was quite a success, so the PS3 had very tough competition on that field. On top of that, Sony made too fancy of an attempt at making the console efficient by using an exotic and obscure processor design which was not supported by any game engine at the time. It actually took several years for game engines to fully take advantage of the peculiar architecture of the PS3 (and even then many game engines never reached its full potential).
In other words, while the PS3 can, in the end, be considered a successful console, it had a very rough start and it took it several years for it to catch up with its biggest competitor. One could estimate that the console was almost doomed because of this, but in the end everything turned out well.
It seems that now the roles are pretty much reversed with the next-gen consoles, ie. the PlayStation 4 and the Xbox One. While the former did not have such a big head start as the previous-gen Xbox compared to its competitor, otherwise the Xbox One is really struggling to keep up with the success of the PS4. (As of writing this, Sony has announced that over 13 million units have been sold, while the same number for the Xbox One is about 5 million.)
One can see similarities in the reasons for this. However, in the case of the Xbox One, rather than the reason being exotic hardware, it's more a question of features and marketing.
The Xbox One had a lousy start well before even the first unit was on the market. Microsoft announced all kinds of draconian restrictions on game sales, sharing and reselling, as well as questionable decisions (like the announcement that the console would be unusable without internet, and that the Kinect, with its cameras and microphone, would need to be on all the time) which were very poorly received by the public. These announcements backfired on them even harder when Sony took advantage of the situation and promoted that the PS4 would not have any such draconian limitations, gaining the favor of the public. Microsoft eventually retracted the majority of these limitations due to the backlash, and while this regained them their reputation somewhat, it was arguably too late, as bad publicity is hard to erase.
Another misfire by Microsoft was the idea to develop and promote the Xbox One as a multimedia platform that sits in between your TV/cable input and the TV, enhancing the features of your normal TV, internet, online streaming, etc. In fact, Much of their presentations at conferences were specifically related to TV.
Rather than, you know, games.
This might have sounded like a good direction on paper, but the people at Microsoft really misfired with this one. People do not buy consoles to be multimedia devices. They buy consoles principally to play games. At the very most they buy consoles to watch BluRay discs, but that's the closest you get. Microsoft spent a lot of time and effort to promote the idea of the console being some kind of extension to TV, and this did not cause much excitement nor interest in the public. What's worse, they went so far that they kind of promoted this notion over the actual games and gameplay. People wanted to see what the console could do with games, but all they got was sales speeches about how the console would enhance your TV watching experience...
The Kinect is another failed idea. It was originally an optional add-on for the Xbox 360, developed very late during its lifespan, and there were only very few games that took advantage of it. With the Xbox One Microsoft had this idea that it would be an integral (and mandatory) part of the console. I'm guessing that they wanted more games to support it, and making it an integral part of every single console, it would promote and entice developers to support it. However, not only did it get tons of bad reputation initially (due to the announcement that it would need to be on all the time in order to use the console), but overall people do not see the need for the peripheral. Most games don't use it, and it's a gimmick at best. The vast majority of people don't feel the need for the Kinect at all.
All this added up to the bad rep of the console, and everything was ultimately topped by the fact that in the end the Xbox One was revealed to be slightly less powerful than the PS4, but cost about 100 dollars more. It's no surprise that the PS4 has oversold the Xbox One three to one (and even more during the first months).
Microsoft has since driven their console's price down by offering a version without Kinect (which goes to show how ultimately pointless their attempt was at making it an ubiquitous part of the console). This has brought the price of the console much closer to its competitor, but nevertheless another form of backfiring is happening here. You see, since Microsoft promoted the Kinect so much, selling the console without it makes make people feel that they are buying an incomplete product; that they might be missing something important if they buy it without Kinect. Granted, many people don't care, but it's still a bit messed up.
Of course both consoles have existed only for less than a year (as of writing this), so the situation will probably equalize a lot in years to come (in the same way as happened with the previous-gen consoles). But at this moment it's the Xbox One that's fighting an uphill battle due to poor decisions.
Even with all those past mistakes behind us now, currently the majority consensus seems to be against the Xbox One, the major reason being its slightly less efficient hardware compared to the PS4. Unlike marketing decisions, this is something that's very hard to fix afterwards.