“We believe in being subject to kings, presidents, rulers, and magistrates, in obeying, honoring, and sustaining the law.” (Articles of Faith, 12)
Some Latter-day Saints take the 12th Article of Faith at face value without understanding the additional context provided in other scriptures and from statements of church leaders.
It’s not uncommon to hear this from a Latter-day Saint: “We are obeying _____ ordinance because it is the law and saints are required to sustain and uphold the law.”
It is important to consider a more complete context of LDS doctrine & teachings regarding obedience to law, lest we act in ignorance.
“And now, verily I say unto you concerning the laws of the land, it is my will that my people should observe to do all things whatsoever I command them. And that law of the land which is constitutional, supporting that principle of freedom in maintaining rights and privileges, belongs to all mankind, and is justifiable before me. Therefore, I, the Lord, justify you, and your brethren of my church, in befriending that law which is the constitutional law of the land; And as pertaining to law of man, whatsoever is more or less than this, cometh of evil.
“I, the Lord God, make you free, therefore ye are free indeed; and the law also maketh you free. Nevertheless, when the wicked rule the people mourn. Wherefore, honest men and wise men should be sought for diligently, and good men and wise men ye should observe to uphold; otherwise whatsoever is less than these cometh of evil. And I give unto you a commandment, that ye shall forsake all evil and cleave unto all good, that ye shall live by every word which proceedeth forth out of the mouth of God.” (D&C 98:4-11)