The Supreme Court has concluded its term with a series of closely watched rulings that could shape immigration policy, women's sports, and campaign funding.