The court was split 5-4 on the ruling, with Justice Amy Coney Barrett writing the majority opinion Photo by Kevin Dietsch