Justice Elena Kagan accused the Supreme Court of risking legitimacy by stepping outside its parameters and becoming too political.