One of the 10 commandments is "Thou shalt not take the name of the Lord, thy God in vain for God will not hold him guiltless that taketh his name in vain." This means we should only use God's name when we are praying or talking about Him to another. In vain mean with no good purpose. When God's name is used as an expletive that is taking God's name in vain.
GOD’S NAME
By Dean Beaty 2/21/08
It is so sad and very odd
They teach the kids, there is no God.
In every way in all their schools
They throw out God and all His rules,
But when in wonder and surprise
They shout His name up to the skies.
It’s too bad they do not bother
To say instead, “Oh my Father.”
Who loves God? It’s not hard to see.
For one’s a curse and one’s a plea.
But if in God they don’t believe,
Then why His name they choose to grieve.
How Satan tricks them all day long.
They use His name in mirth and song.
But not until bowed down with care,
They learn to use His name in prayer.