The mayor could be sued for falsifying city documents - no?
Oh, I think not only should the mayor be sued but every city functionary who, knowing that these 'marraiges' were against the law, went ahead and altered documents, handed them out and performed the ceremonies.
In government employment, you are indemnified against lawsuits if you are performing your duties according to the law, local codes and standard operating procedures. If you knowingly break the law or somehow decide that you will establish some heretofore illegal policy, you become personally responsible for your actions.
I think some smart lawyer ought to be hooking up with the 'newlyweds' with the intent to sue not only the City and County of San Francisco, but each municipal officer who takes part in this illegal dog and pony show.
I know I'd pay good money to see that...