US president says ‘the court once again walked away from decades of precedent’, as Democrats decry supreme court’s affirmative action ruling