The Supreme Court delivered victories for religious freedom advocates and the Trump administration on its final day.