The Midrash, in a well-known passage (Vayikra Rabba 30:12), explains the four species as symbols of different types of Jews. The etrog, with its pleasing fragrance and sweet taste, symbolizes the righteous scholars among Am Yisrael who excel in both Torah study and Torah observance. The lulav, which is scentless but comes from a palm which produces luscious dates, symbolizes those who immerse themselves in Torah learning but fall short in their observance, whereas the hadas, which has a fragrance but is inedible, represents those who observe but do not devote time to study. Finally, the arava represents those whose commitment to both learning and observance is inadequate.
The Bach (O.C. 216), interestingly enough, references this Midrash in a halakhic context, in regard to the question surrounding the recitation of a berakha when smelling the etrog. The Tur (O.C. 653) writes (based on the Gemara, Sukka 37b) that it is permissible to smell the etrog on Sukkot, despite the fact that it has been designated for a mitzva, because as an edible fruit, its primary non-mitzva use is consumption, not fragrance. The etrog’s designation for the mitzva, the Tur writes, requires that we refrain only from using it for its primary mundane purpose – eating – but not from smelling it. Normally, when one smells a fragrant fruit to enjoy its scent, he recites the berakha “she-natan rei’ach tov ba-peirot,” and the Tur (both in 216 and 653) cites the view of the Ra’avya that one recites this berakha when smelling the etrog on Sukkot, as well. However, the Tur then notes the opinion of Rabbeinu Simcha who disagreed, and maintained that since this etrog had been set aside for use as a mitzva article, it is not regarded as a standard fragrant fruit, and thus a berakha is not recited. Its identity is that of a mitzva object, and is thus not intended to be used for fragrance, and therefore, no berakha should be recited when smelling it. The Bach comments that in light of the aforementioned passage in the Midrash, it could be argued that indeed, the etrog used for the mitzva is intended to be smelled. Since its fragrance is an integral part of its symbolic meaning, one should have this symbolism in mind when fulfilling the mitzva of arba minim, and the etrog is, in fact, meant to be used for its fragrance. The Bach observes the custom to specifically smell the etrog when fulfilling this mitzva, explaining that this is done to bring to mind the symbolic message of the etrog, representing the righteous scholars among Am Yisrael.
Nevertheless, the Bach concludes that it is preferable not to smell the etrog which is used for the mitzva, in order not to place oneself in a situation of uncertainty regarding the requirement to recite a berakha. This is also the ruling of the Shulchan Arukh (O.C. 216:14, 653:1). As for the custom mentioned by the Bach to smell the etrog before fulfilling the mitzva, his son-in-law, the Taz (653:1), cites the Semak as commenting that this is a “minhag shetut” (“foolish practice”).
The Magen Avraham (216:21) cites the Maharshal as drawing a distinction in this regard between the time when one takes the etrog to fulfill the mitzva, and at other times during Sukkot. According to the Maharshal, it is only at the time when one fulfills the mitzva that Rabbeinu Simcha maintained that no berakha is recited before smelling the etrog. If one wishes to smell the etrog at some other time during Sukkot, then all views agree that a berakha is recited, since at that moment, the etrog is not being used for the mitzva. The Chafetz Chaim, in Bei’ur Halakha, notes that other poskim disputed the Maharshal’s ruling, but he sides with the Maharshal, arguing that there is no reason not to recite a berakha when smelling the etrog when it is not being used for the mitzva, even during Sukkot.