God didn't tell them they had to eat food, he told them food was available and that it was for them.
Genesis 1:29-31 ESV And God said, “Behold, I have given you every plant yielding seed that is on the face of all the earth, and every tree with seed in its fruit. You shall have them for food. And to every beast of the earth and to every bird of the heavens and to everything that creeps on the earth, everything that has the breath of life, I have given every green plant for food.” And it was so. And God saw everything that he had made, and behold, it was very good. And there was evening and there was morning, the sixth day.
God also told Adam that the garden was for them to work and grow food in it--presumably to eat.
Genesis 2:15-16 ESV The Lord God took the man and put him in the garden of Eden to work it and keep it. And the Lord God commanded the man, saying, “You may surely eat of every tree of the garden ...”
So you wonder why God did all this? Because it was paradise. Eating is pleasurable. Jesus talked about eating in a pleasurable and Utopian light:
Mark 14:25 ESV Truly, I say to you, I will not drink again of the fruit of the vine until that day when I drink it new in the kingdom of God.”
Revelations 3:20 ESV Behold, I stand at the door and knock. If anyone hears my voice and opens the door, I will come in to him and eat with him, and he with me.
Psalm 23:5 ESV You prepare a table before me in the presence of my enemies; you anoint my head with oil; my cup overflows.
God didn't give Adam and Eve food because they needed it to survive. He gave them food because God loves giving his children good gifts and food is one of them.