Plans to loosen Germany's strict debt rules have cleared their last hurdle in parliament, paving the way for big spending on defence and the economy.