Deficit spending is used by governments to mitigate the economic effects of a recession. It is logical that the 2008/2009 financial crisis (incidentally brought on by Republican policies) also saw the largest deficit spending. If that deficit didn't exist we 100% would have experienced a second great depression. That deficit saved all of our butts.
Smaller deficits continued throughout Obama's tenure because the recovery from a banking crisis takes much longer than a traditional recession. Businesses were scared to hire and spend for years. So government stepped in. Many argue more should have been spent. After all, the US didn't start to exit the Great Depression until the deficit spending of the New Deal and WW2.
Deficits are not a Democrat vs Republican issue. In fact, the 2nd, 3rd and 4th largest cumulative budget deficits all belong to Republican presidents. Moreover, Trump appears to on track to join these ranks with a $1 trillion deficit for 2018 alone - a figure that many expect to grow during his tenure.
Also, none of these Republican presidents were fighting the forces of a second great depression.