This is Moses speaking to the children of Israel about their experiences in the wilderness:
And he humbled thee, and suffered thee to hunger, and fed thee with manna, which thou knewest not, neither did thy fathers know; that he might make thee know that man doth not live by bread only, but by every word that proceedeth out of the mouth of the Lord doth man live. (Deuteronomy 8:3)
We recognize that the Savior paraphrased this verse when tempted by the devil to turn stones into bread after He fasted 40 days. It is possible Christ took the first part “he humbled thee, and suffered thee to hunger” as instruction that He had to endure hunger like other people and be humbled. Satan probably wanted Christ to focus more on the part, “he…fed thee with manna, which thou knewest not” in order to tempt Christ to turn the stones into bread.
But returning to the children of Israel, how was the miracle of manna supposed to teach them to live by the word of God and not just by bread?
I think it was because of the instructions and commandments associated with gathering the manna. There were instructions about how much they should gather and when to gather it. There were instructions about not saving it beyond one day. There were even instructions about when they should not expect to gather it—during the Sabbath—and how to compensate for that.
To eat every day, they had to follow those instructions. If they didn’t, they would start to starve. If they persisted in disobedience, they would die. Every instruction had a purpose, and not a single instruction could be neglected without consequences. I suppose it is always so with the commandments.