How does melody impact lyrics?

Today in class as we sang the same lyrics to different melodies, I found it very interesting to experience how melodies affect lyrics and vice versa. As we learned today, common meter gives us the ability to sing different lyrics to the same melody, but is this something we should do? Does changing the melody take away from our understood meaning or translation of the lyrics? This is, of course, a matter of opinion, but today I found that if the connotation, or the feeling, that a  melody gives us, does not match up with the connotation of the lyrics, the meaning of the scripture can be distorted. Most religious people would consider scripture to be sacred texts, therefore, adding a frivolous melody would work to undo the seriousness of the text. For example, today we sang a Psalm to the melody of Yankee Doodle. Adding this melody gave the lyrics a much more trivial feel than was ever intended. Likewise, one wouldn’t want to add a sad or negative connotative melody to lyrics which are meant to be encouraging or positive. On the other hand, using familiar melodies with unfamiliar lyrics can help us learn quickly which can be beneficial in many circumstances.