Barack Obama appointed only two Supreme Court justices—Sonia Sotomayor and Elena Kagan—in his eight years in office. It could have been much worse.