Obama's deficits shrunk because the Republican Congress fought him. Remember when we were the "Party of No" for not supporting all the spending measures Obama wanted?
But you're not wrong that there is zero excuse/reason for having a deficit this high at this point in the economic cycle. None. Congressional Republicans will fight for more fiscal discipline when there is a Democrat in the White House (Clinton, Obama) but not a Republican (Bush, Trump).
We have a trillion dollar deficit because no one will touch spending. No one will touch entitlements and we have a massive increase in military spending.
Bookmarks