States that fought same-sex marriage owe millions in legal fees