The blessings of Shelo Asani Goy, Shelo Asani Aved, Shelo Asani Isha:
Aside for the above blessings [which cover the physical benefits that one receives on a daily basis] one is also obligated to recite the following three blessings: Shelo Asani Goy; Shelo Asani Aved; Shelo Asani Isha. These blessings are recited in thanks to G-d for creating us as a free male Jew, which has the merit and obligation to fulfill all of G-d’s commands that are given in the Torah, as a gentile, slave, and female, are only obligated in certain commands. Alternatively, the Kabalists explain that these three blessings are recited in thanks to G-d for not attaching to our soul, which ascended during sleep, the spirit of a gentile, slave, or woman. [Alternatively it is said as a thanks to Hashem for not originally placing our soul into the body of a gentile, slave or woman.]
 46/4; The positioning of these blessings here follows the order of laws in Shulchan Aruch. However practically these blessings are said before the blessing of Hamavir as it is like a preparation for the Davening, to which Hamavir is compared to as explained above.
 The Nussach of this blessing: In the older prints of the Shulchan Aruch it states “Shelo Asani Nachri”. However in the Luach Hattikun it states that it should really say Goy, and so has been printed in the new editions of the Shulchan Aruch and this is the way that the blessing is written in the Siddur. In the Rama 46/4 the Nussach is “Shelo Asani Akum”. [See Piskeiy Teshuvos 46/6]
 Admur 46/5 based on Beis Yosef, Levush; Kaf Hachaim 46/32
There is an advantage and disadvantage between all these three types of people: Although a gentile is worse than a slave in terms of his current obligation in Mitzvos, nevertheless there is an advantage of a gentile over a slave being that a slave does not have any lineage, as his children do not follow his ancestry but rather the mother, just like by an animal. This is learned from the verse “Shevu Lachem Poh Im Hachamur” that a slave is similar to a donkey in this regard. However a gentile [does continue the lineage of his father]. Furthermore a gentile is able to convert on his own accord and become a full fledged Jew. This is opposed to a slave [which requires his master to free him]. The disadvantage of a woman is that she is unable to become obligated in all the Mitzvos. This is unlike a gentile whom can convert and a slave which can be freed by his master. We thus must give thanks to Hashem that he did not create us as even the best of these three, but rather we merited to serve Hashem and be closer to him than any of the above three types of people. [ibid]
 M”A 46/10; Matzas Shmurim Kavanas Habrachos; See Kaf Hachaim 46/32
 First explanation of Matzas Shmurim brought in Kaf Hachaim ibid, omitted by Admur. See there that certain sins can cause ones soul to be reincarnated into a gentile, slave or woman, and hence we must thank Hashem daily for this not having occurred. Rav Avraham Azulai explains the reason for saying the blessing of “Shelo Asani Goy” is because after Avraham was chosen by Hashem all the Jewish souls are brought from one source and all the gentile souls from another. However prior to Avraham all the souls, both pure and impure were received from the same source. [Birkeiy Yosef 46/7]