The court's decision marks a blow to the Trump administration's efforts to roll back protections for LGBT communities.