The Rama (O.H. 25:11), cites Rabbi Ya’akov Landau (Sefer Ha’Agur) who quotes the Zohar (Parashat Bamidbar), and writes that there is an opinion that the Tefilin Shel Yad should be placed sitting, followed by the Tefilin Shel Rosh which is placed standing up. There is a general concept that for the most part, Mitzvot as well as their blessings should be recited standing up. Interestingly, Rabbi Yosef Messas (Mayim Haim, vol. II, § 93), quoting his uncle Rabbi David Messas, brings scriptural support for this concept from the verse (Tehilim 33:11): “Atzat Hashem Le’Olam Ta’amod”. Each letter of these words represents different Mitzvot such as Amida, Tzitzit, Tefilin, Lulav, Omer, Levana, Mila, Tekia, Eruv, Mekadesh (Kiddush) and Diberot (standing for the Ten Commandments), and the verse ends with the word “Ta’amod”, indicating that these acts should be performed while standing.
Regarding Tefilin, however, the Zohar (ibid.) states that the Tefilin Shel Yad is placed sitting down because it corresponds to all the prayers which are recited sitting down, while the Tefilin Shel Rosh corresponds to the prayer recited standing up, namely the Amida, and thus is placed standing up. The Arizal concurs and it appears that according to Kabbalah the custom is that the Tefilin Shel Yad is placed sitting down.
Regarding the Moroccan custom, Rabbi Shalom Messas (Tevuot Shamesh, Orah Haim, § 67 and Shemesh Umagen, vol. IV, § 6) and Rabbi Avraham Amar (end of Magen Avot) write that lay people would place both Tefilin standing up. Those that were more learned and were involved in the study of Kabbalah, on the other hand, would place the Tefilin Shel Yad while sitting. Nevertheless, Rabbi Yedidia Monsonego (Pirhe Shoshanim), Rabbi Itzhak Hazan (Yehave Da’at, vol. I, § 5) and Rabbi Yehoshua Maman (Emek Yehoshua, vol. I, § 34 ) write that the custom in Fes, Marrakech and Sefrou, respectively, was that everyone would place the Tefilin Shel Yad while sitting down, whether one was learned or not.
Given this dichotomy in customs, the Siddur Bet Oved says that one way to reconcile them is to recite the blessing of the Tefillin standing up and then to sit down to place the Tefilin Shel Yad. Nevertheless, although according to the basic interpretation of Halacha, both Tefilin are placed standing up, it seems as though the custom involved for most communities to follow the Kabbalistic approach and to place the Tefilin Shel Yad while sitting.
Summary: Unless one has a specific custom to place both Tefilin while standing up, the Moroccan custom is to place the Tefilin Shel Yad while sitting down, and the Tefilin Shel Rosh while standing up.