A few years ago, in a conversation with a childhood friend of mind, he told me that the thing he can’t accept about the God of the Bible is that he is described as being “jealous.” My friend insinuated that he could never respect a God who had such a petty and insecure character trait.
Several times in the Bible, God refers to himself as a “jealous God.” For example, in the 10 Commandments, God tells his people not to worship other gods, because he is a jealous God.
What’s interesting, is that jealousy is listed in the New Testament as being one of a handful of sins which are called “the works of the flesh” and are contrasted with “the fruits of the Spirit” in Galatians 5.
Now the works of the flesh are evident: sexual immorality, impurity, sensuality, idolatry, sorcery, enmity, strife, jealousy, fits of anger, rivalries, dissensions, divisions, envy, drunkenness, orgies, and things like these. I warn you, as I warned you before, that those who do such things will not inherit the kingdom of God. (Galatians 5:19-21)
How can God have a characteristic which the Bible itself calls sinful?
There are two answers to this question:
1. Two Different Greek Words – With Two Different Meanings
The confusion over the word jealous being attributed to God is really a matter of the weakness of the English language. In Greek, two very distinct words, with distinct meanings, are used to describe these two attitudes:
In Galatians 5:21, where jealousy is listed as a sin, the word is: φθόνος (phthonos) – which is more akin to envy or covetousness: it connotes ill-will towards someone because of something they have which you want for yourself. 
In James 4:5, where God is described as jealous, the word is: ἐπιποθέω (epipotheo) – which means to dote upon or desire intensely. 
In other words, God is not described as having a sinful characteristic at all. The confusion comes from the deficiency of the English language, or perhaps of the translators to find better words to differentiate these two concepts.
2. Why It is Good that God is “Jealous” for His People
One definition of jealousy in the dictionary is: “fiercely protective or vigilant of one’s rights or possessions”
This is the essence of what the Bible is talking about when it describes God as a jealous God. It means that when it comes to his people, he desires our hearts to be fully his, and he desires exclusivity in that relationship — hence the first commandment: You shall have no other gods beside me.
Throughout the Bible, God describes his relationship with his people as a marriage – a covenant relationship. God calls himself the husband of his people; in the Old Testament, Israel is referred to as the wife of Yahweh. In the New Testament, the church is called the Bride of Christ, and Jesus is called the Bridegroom. This is why idolatry is compared in the Bible to adultery against God.
It is appropriate for a spouse to be fiercely protective of the exclusivity of their marriage, and be opposed to anything which would try to come in and threaten it.
When we first moved to Colorado, my wife went to a dentist. After that first appointment, Dr. Brian began calling her on the phone and sending handwritten cards. Maybe he was just following protocol, but as a husband, I didn’t like Dr. Brian sending my wife cards and calling her on the phone!
The fact that God is jealous for his people is a wonderful thing. It means that God doesn’t just tolerate you, He doesn’t just put up with you — but He is fiercely passionate about His love for you!
This kind of fierce, passionate love is described in the Song of Solomon: Set me as a seal upon your heart, as a seal upon your arm, for love is strong as death, jealousy is fierce as the grave. Its flashes are flashes of fire, the very flame of the Lord. Many waters cannot quench love, neither can floods drown it. (Song of Solomon 8:6-7)
That is the kind of love that God has for you. It is the kind of love that moved the God of the Universe to leave his heavenly throne, and become one of us — to walk our dusty streets, and be despised by the very people he created — and ultimately to be nailed to a cross in order to redeem you. This love is at the very heart of the gospel.