Most people think the tree of the knowledge of good and evil (Genesis 2:17) was an apple tree. They have no idea why or what that interpretation is supposed to mean. The Rabbis have lots of interpretations and all of them provide insights into the meaning of the Torah’s account of what it means to be “like God, knowing good and evil.” (3:5)
Rabbi Yose said it was a fig tree for as soon as they ate from it their eyes were open and they covered themselves with fig leaves. (3:7) This is the simplest explanation and has the most textual support but it doesn’t tell us why figs represent morality.
Rabbi Judah bar Ilai said they ate from a grapevine i.e., wine (alcohol) represents good and evil because wine can be used to sanctify the Sabbath or to make one an alcoholic.
Rabbi Meir said it was a wheat tree i.e., wheat was the first crop to be domesticated and thus represents the beginning of farming and then urbanization-civilization. Settled life is a great test of social morality because nomads can always split apart if they can’t live together but settled people must develop an ongoing legal system and abide by it.
Rabbi Abba said it was an etrog tree. An etrog, used for Sukkot-harvest festival, is called a goodly tree and it is good to thank God for the harvest. (Leviticus 23:39-42) Gratitude is a spiritual value transcending ethics involving attitude and feeling.
There are four ways of interpreting a sacred text and thus four kinds of Midrash. The first is the plain simple way. This may be the literal or common sense way of Rabbi Yose.
The second way is moral lesson pedagogic way of Rabbi Judah bar Ilai. He wants to teach people that many things like the grapevine are capable of being used for good or evil purposes. They are not intrinsically good or evil. We can choose how we use them, so we make them good or evil. (Sex, money and meat eating are other examples.)
The third way is the metaphor allegory way of Rabbi Meir who was reputed to know dozens of fox fables. Rabbi Meir thinks social morality is the primary sign of humanity. Farming brings about relatively dense settlements, property disputes, government and hierarchies. All of this calls for a just legal system. Thus wheat is a good metaphor.
The fourth way is the mystical psychological way of Rabbi Abba. The etrog is part of the citrus family. Unlike an orange, a lemon or a grapefruit an etrog has no commercial value. Jews give it a high value (each one costs 100X what a lemon costs) for spiritual reasons. So too does morality have a value much greater than simple humanistic ethics.
I say it was a Torah tree. Torah is called a tree of life (Proverbs 3:18) and most Jews who study Torah and do mitzvot live longer than most Jews who do not. Since it is desirable to live a long life it is wise to live morally.