Every engine has a failure rate. Some are higher than others.
The 5.7 is not a bad engine. The failures you hear of drown out the millions of satisfied owners that don't get on the internet to praise their engine.
I am one of the millions that have had great service from this engine. I am closing in on 395,000 on a 2007 Ram 1500. It is starting to show some signs of being near the end but it has been great. Mine still idles great, makes decent power but has always used a bit of oil. I started it yesterday afternoon and had steam coming from the exhaust in 70 degree weather. That means an internal leak, maybe a head gasket. I'm destined to put another engine in this truck since I still like it.