A couple of related scriptures come to mind:
“Whatever principle of intelligence we attain unto in this life, it will rise with us in the resurrection. And if a person gains more knowledge and intelligence in this life through his diligence and obedience than another, he will have so much the advantage in the world to come” (D&C 130:18-9).
“And that wicked one cometh and taketh away light and truth, through disobedience, from the children of men, and because of the tradition of their fathers” (D&C 93:39).
The third Article of Faith states, “We believe that through the atonement of Christ, all mankind may be saved, by obedience to the laws and ordinances of the Gospel.”
“And we are willing to enter into a covenant with our God to do his will, and to be obedient to his commandments in all things that he shall command us, all the remainder of our days, that we may not bring upon ourselves a never-ending torment, as has been spoken by the angel, that we may not drink out of the cup of the wrath of God” (Mosiah 5:5).
“There is a law, irrevocably decreed in heaven before the foundations of this world, upon which all blessings are predicated—And when we obtain any blessing from God, it is by obedience to that law upon which it is predicated” (D&C 130:20-1).
“And inasmuch as he is faithful in keeping my commandments, which I have given unto him, I will multiply blessings upon him and his seed after him, even a multiplicity of blessings” (D&C 104:42).
“Though he were a Son, yet learned he obedience by the things which he suffered” (Hebrews 5:8).
“And Eve, his wife, heard all these things and was glad, saying: Were it not for our transgression we never should have had seed, and never should have known good and evil, and the joy of our redemption, and the eternal life which God giveth unto all the obedient” (Moses 5:11).
“If any man will do his will, he shall know of the doctrine, whether it be of God, or whether I speak of myself” (John 7:17).
“But be ye doers of the word, and not hearers only, deceiving your own selves. For if any be a hearer of the word, and not a doer, he is like unto a man beholding his natural face in a glass: For he beholdeth himself, and goeth his way, and straightway forgetteth what manner of man he was. But whoso looketh into the perfect law of liberty, and continueth therein, he being not a forgetful hearer, but a doer of the work, this man shall be blessed in his deed. If any man among you seem to be religious, and bridleth not his tongue, but deceiveth his own heart, this man’s religion is vain. Pure religion and undefiled before God and the Father is this, To visit the fatherless and widows in their affliction, and to keep himself unspotted from the world” (James 1:22-7).
“And now, how much more cursed is he that knoweth the will of God and doeth it not, than he that only believeth, or only hath cause to believe, and falleth into transgression?” (Alma 32:19).
“He that saith, I know him, and keepeth not his commandments, is a liar, and the truth is not in him” (1 John 2:4).
“Not every one that saith unto me, Lord, Lord, shall enter into the kingdom of heaven; but he that doeth the will of my Father which is in heaven. Many will say to me in that day, Lord, Lord, have we not prophesied in thy name? and in thy name have cast out devils? and in thy name done many wonderful works? And then will I profess unto them, I never knew you: depart from me, ye that work iniquity” (Matthew 7:21-3).
“And it came to pass that I, Nephi, said unto my father: I will go and do the things which the Lord hath commanded, for I know that the Lord giveth no commandments unto the children of men, save he shall prepare a way for them that they may accomplish the thing which he commandeth them” (1 Nephi 3:7).
“Yea, and they did obey and observe to perform every word of command with exactness; yea, and even according to their faith it was done unto them; and I did remember the words which they said unto me that their mothers had taught them” (Alma 57:21).
“And Samuel said, Hath the Lord as great delight in burnt offerings and sacrifices, as in obeying the voice of the Lord? Behold, to obey is better than sacrifice [zebach, ‘offering’], and to hearken than the fat of rams” (1 Samuel 15:22).
“Let no man break the laws of the land, for he that keepeth the laws of God hath no need to break the laws of the land” (D&C 58:21).
“Let us hear the conclusion of the whole matter: Fear God, and keep his commandments: for this is the whole duty of man” (Ecclesiastes 12:13).
“Behold, the Lord esteemeth all flesh in one; he that is righteous is favored of God” (1 Nephi 17:35).
Obedience is not a set of arbitrary hoops to jump through. Certain things are in place because things would not work well any other way. We would not want a malevolent, disobedient, all-powerful being in the universe. God is willing to share everything, all power and all knowledge, to those who are worthy, to those who are able to control that power and knowledge. All power and knowledge is not just freely given to everyone.