The Gemara (Berachot 5b) states that one should not place one’s bed such that its length runs from east to west, but rather from north to south. Rashi (ibid.) explains that Hashem’s Presence is situated to the east and to the west and it would be inappropriate to engage in relations in these directions. The students of Rabbenu Yona also explain that in the Bet Hamikdash the Menora, symbolizing wisdom, was in the north and the Shulhan (table), representing wealth, was to the south and as such, one’s bed should be arranged accordingly. Furthermore, at the time of conception one should pray that one merits children who are wise and who are wealthy, so that they do not need to depend on others. Based on this, the Shulhan Aruch (Orah Haim 3:6) rules that it is forbidden to sleep in an east-west direction when one is with one’s wife and it is proper to be careful not to do so even without one’s wife.
Nonetheless, the Zohar (Bamidbar) appears to suggest the opposite-that one should place one’s bed east to west with the head towards the east, and not north to south. It explains that when Adam was created, his head was created in the east, his feet in the west, his right arm (representing kindness) in the north and left arm (representing strict justice) in the south. The Ben Ish Hai (Shana Bet, Vayera, § 25) and other Mekubalim agree with the opinion of the Zohar. The Mishna Berura (O.H. 3:11) mentions this difference of opinion and cites theVilna Gaon, who says that the Zohar’s position is actually like that of the Gemara.
That said, Rabbi Haim Benveniste (Knesset Hagedola), writes that since some opinions say that one should position one’s bed in one direction and specifically not in the other, or vice versa, one can place one’s bed in the direction one wishes. The Aruch Hashulhan (O.H. 3:13) writes that the custom nowadays is to not be particular regarding the bed’s position since there are varying opinions. Rabbi Ben Zion Abba Shaul (Or LeZion, vol. II, ch. 1, §1) echoes this opinion, but says that if possible one should place the head of one’s bed to the east and the foot of the bed to the west. Rabbi Ovadia Yosef, quoted in Halacha Berura(O.H. 3:9), appears to concur as well.
It should be noted that some commentators say that even though the Shulhan Aruch (ibid.) uses the word “forbidden”, it is not an actual prohibition but simply a proper practice. Furthermore they mention that this was left out altogether in the Tur and was only mentioned in the Shulhan Aruch.
Summary: The custom nowadays is to be lenient and to place one’s bed in any direction one desires but preferably, the head should not be facing west.