LDS / CA Prop 8 / Tax exempt status

I’ll preface this by saying that I’m not particularly well versed in U.S. law. I tried searching for a previous thread, and found none, so here goes.

From what I have read, the church of LDS spent tons of money on the Yes on 8 campaign in California. Now, I have understood that churches may not engage in politics if they want to keep their tax exempt status. I just can’t see how the LDS can lobby for a constitutional amendment in a state and claim to be apolitical.

Please, de-ignoranceify me.

I was apparently searching with my eyes closed. Mods, please delete this thread.