No court has ever ordered California to "comply with immigration laws".
And Kim Davis isn't being "punished" for anything.
Since when is being jailed for one's religious beliefs (or anything else) not a punishment?
You are being ridiculous. She is not being jailed for her religious beliefs.
She is contempt of a court order. She willfully disobeyed. She told the court that she would continue to disobey. She was placed in jail to coerce her obedience with the court's order. She can get out of jail anytime she wants if she agrees to obey the court's order. She is still entitled to believe anything she wants.
Why is she willfully disobeying?
Because of her religious beliefs that marriage should be between one man and one woman.