Now that this pesky SSM case is out of the way, this does seem like a viable solution to give unpopular referendums a defense:
States such as California, with laws allowing ballot initiatives, should also enact laws requiring that a special attorney for the state be appointed in each instance that the government elects not to defend an initiative. Such a process would be well within the bounds of established law, since states get to decide for themselves who will represent them in court.
Because the attorney, even if not a state employee, would be appointed by the state, he or she would be representing the state and therefore have standing. This sort of appointment of outside counsel already happens in certain other instances, such as when there is a conflict of interest. The only difference here would be that, whenever the state opted not to defend an initiative passed by voters, an appointment would be required.
Such a law would be completely consistent with the Supreme Court’s ruling in the Proposition 8 case. The court held that it has never allowed the supporters of a law to defend it when the state chooses not to do so. With the mechanism I propose, it would still be the state defending the law; it would just be represented by a special attorney, something well within the state’s prerogative and within the Constitution’s requirement for standing.