The verses that refer to God as a "jealous God" are often misunderstood. We are accustomed to jealousy referring to "envy" or "bitter resentment." However, this is not the intended meaning of the word jealous when used in reference to God. A better translation would be "zealous."
Webster's Seventh New Collegiate Dictionary has this as one of the definitions of jealous: "vigilant in guarding a possession." This is the proper sense in which we should understand this word as applied to God. Please compare Exodus 20:5 with Deuteronomy 4:24 and Hebrews 12:29.