I honestly can't decide whether to say this is unexpected or expected.
Why it's expected: S&P has made it very clear the downgrade occurred because of political gridlock, not because of the size of the debt or the state of the US economy. And they're correct! Nobody in their right mind could look at the last month of US politics and declare US debt almost perfectly safe. Countries rated AAA shouldn't come within two days of openly defaulting on their obligations, and the debt deal doesn't change that. What if Congress hadn't reached a deal in time? What if some quirk of parliamentary procedure delayed the deal past the deadline? When you're walking that close to the wire, there are simply too many things that can go wrong to say the debt is "risk-free." And Congress has made it quite clear that July's standoff will be the norm from here on out. Really, AA+ might be too good for us, even.
Why it's unexpected: on the other hand, it doesn't make any sense to downgrade the debt right now -- nothing's changed in the last few days. And while political gridlock is a perfectly legitimate reason for a downgrade, gridlock has been a reality for a while now. The timing of the downgrade makes me think S&P was waiting to see the final debt deal before passing judgment, which is silly of them. All the relevant facts were in place two months ago: the debt was large, no plausible congressional bargain could reduce it, Congress was a feeble, broken institution, and the economy was lousy.
By having a debt ceiling standoff, Congress was playing Russian Roulette with the economy. You don't need to wait for the result to know that Congress was engaging in some pretty risky behavior.
Which brings me to my final point: the real reason the downgrade happened is because S&P painted itself into a corner. It started issuing edicts: either we strike a deal with $4 trillion in deficit reduction or the US loses its AAA rating. We didn't, so it did.
It was always a bit strange to see an agency charged with passively rating debt trying to influence policy. And this is why: now, it's hard to know to what degree S&P's new rating is because of honest evaluation of the facts, and to what degree it's because of a political position it had staked out in advance and now must defend. S&P might have damaged the America's reputation with this downgrade, but it's damaged its own, too.