US President Barack Obama hailed the Supreme Court's decision to uphold his legacy-gilding health care law.