Legalizing same-sex marriage could bring tax windfall to states