I suspect that passage of this was a part of backroom quid pro quo in exchange for a conscience clause giving military chaplains the right to refuse to perform same-sex marriages.
I suspect this is the last nail in the coffin for the republic. It's official we live in a homo/green/socialist country and there is nothing that will change it short of Civil War.