If you use God's name "in vain", as a curse or profanity, then you are using His name contrary to it's nature (as in prayer or to summon healing or soothing energies). Therefore, you're "taking the Lord's name in vain," empty and devoid of it's Lordly purpose.