1. The Gemara (Sanhedrin 101a) states that, “One who reads a pasuk from Shir HaShirim and transforms it into a sort of song or sings a pasuk in an inappropriate time such as at a party (beis hamishtaos) brings evil to the world, since the Torah wears sackcloth and complains before Hashem, ‘Your children have made me into a musical instrument that is played by scorners (leitzim).’”
2. Although this passage is not quoted by either the Rambam or the Shulchan Aruch, the Magen Avraham (560:10), citing the Maharil, writes that it is improper to use pesukim as lyrics for songs that are “sung at simchat mereius” (discretionary gatherings). The Taz (560:5) adopts a similar approach to that of the Magen Avraham. The Mishnah Berurah (560:14) and the Aruch HaShulchan (560:7) cite the words of the Magen Avraham as well.
3. The very widespread practice today among even the most pious of Jews is to sing and listen to music whose lyrics are from Torah sources. Indeed, even Rav Moshe Feinstein, who himself rules strictly, acknowledged that, “Many are lenient and listen to tapes [of music whose lyrics are from Torah passages], and even in the previous generation people would play records of music whose lyrics were derived from Torah passages, and the rabbis of that generation did not register protest. And we see [today] that the majority of Torah observant Jews listen to such music including even the most pious of individuals.” (Igros Moshe Y.D. 2:142 and Y.D. 173)
4. Rav Moshe suggests that those who are lenient might argue that the Gemara refers only to Shir HaShirim, as there is more concern that the verses from that Sefer might be misinterpreted as a simple love song between a man and a woman, and not as an allegory to the love between Hashem and Am Yisrael, as Chazal interpret it. Rav Moshe notes that the difficulty with this approach is that Rashi in Sanhedrin 101a clearly believes that this prohibition applies to all of the Torah, and not just to Shir Hashirim. Moreover, the aforementioned Magen Avraham, Taz, and Mishnah Berurah appear to apply this prohibition to all parts of Torah.
5. A much stronger justification for the common practice might be derived from the Yad Ramah. The Yad Ramah writes that this prohibition exists only if the pesukim are sung derech sechok, in a joking or degrading manner, (although he cautions that he is unsure about this). This also seems to be the view of Rashi. Harav Nosson Gestetner zt”l also discusses this issue and agrees that it is only prohibited if the versus are song in a degrading or joking manner. Rav Ovadia Yosef zt”l also rules that the prohibition applies only if the pesukim are used for love songs or for leitzanus, frivolity. He argues that the Yad Ramah’s uncertainty is resolved by the many eminent rabbanim and communities who have adopted the lenient approach to this issue. (Yabia Omer 3:15)
6. Harav Nissam Karelitz shlit”a adds that one may not even listen to someone sing verses of Torah, even if he is not singing along with him. He does write that one may sing and listen to the music if the music gives him inspiration. (Chut Shani Shabbos vol. 2 page 334) Similarly, Harav Nosson Gestetner zt”l (Lehoros Nason 4:45) writes that if one focuses on the meaning of the words, then he may listen to the music.
7. Under most circumstances the music at weddings is meant to enhance the simcha and is not considered frivolous. There are songs, however, where the versus are sung in jest or simply because they are catchy. In these cases it becomes less clear of the intentions of the singer and what purpose the versus serve. And in these cases the singer and listener should focus on the meaning of the words and try to gain inspiration from the music. Harav Yisroel Reisman shlit”a, in a shiur given on Sefer Tehillim, says that at weddings he tries to focus on the words of the songs and their meanings. This can turn a potentially frivolous song into an inspirational song.