There's a lot of parts that make up the whole, but at the end of the line, it's all about $$$$$ ... it's ALWAYS about $$$$$.
Until the airlines are willing to pay a decent wage for their smaller operations (size aircraft) and/or entry-level pilots and until the traveling public is willing to pay more for a ticket to fund those pay raises and until the FAA comes down 'harder' on training AND performance than the age-old mantra of '70% and fly' being good enough .... these things will continue to happen.
You get what you pay for ... and you bet your life, accordingly.
Believe it.