It's no longer an issue, but over the last decade QB salaries were inflating faster much than the salary cap was rising. As bad as Bleacher Report is,
this article has the numbers to back it up. As a tl;dr, the top 10 QBs cost an average of ~3% more of the salary cap in 2013 vs 2006, and ~4% more in 2013 vs 2000.
Again, it probably won't be an issue, but the risk of letting a guy like Flacco or Cutler go is too high for management/coaches to seriously consider doing. You're obviously right, spending a large amount of money on one position lowers your competitive ability to secure good players at other positions, and generally weakens teams as a whole (unless they are very, very good at drafting), but when the alternative could be "shitty quarterback -> shitty season -> 1st round QB -> QB bust -> cycle continues until coach/GM get fired (or possibly longer)" you can see why teams WANT to pay Flacco and Cutler tons of cash.
Not 100% sure how the salary cap is calculated, as it's not just a "profit/32" kind of thing, but I'm guessing the league got together and noticed the issues these super-contracts were having or could have on the bottom half of the league. It's not good for veterans if they have to get cut to pay these contracts, and it's not good for the sport either.