Teams over the cap aren't inherently in salary cap hell. Teams over the cap with long-term contracts off players who are either terrible or no longer playing often are. Obviously, a team with Shaq and Kobe is going to be good even with two max salaries (actually, at least Shaq was more than the max salary). You can get a solid player who will work for the mid-level exception (particularly for a chance to win).
But how many teams who have been terrible for years are also over the cap? The draft really isn't strong enough to get out of a funk. Teams that end up rebuilding and doing well essentially have to completely blow up their team and start over - massively shed salary by trading for expiring contracts and letting all good players on your team walk.
The NBA is much better for dynasties compared to other leagues - the Lakers and Spurs can build up a run of championships. But it's nowhere near as good for parity and plenty of teams will be terrible for years at a time (compared to the NFL where only the chronically mismanaged will stay terrible).