Jealousy is mentioned in three different contexts in the Bible. Twice it is seen as a positive emotion, and once as negative.
What does the Bible teach about jealousy?
The jealousy of God for the hearts of His people. Several times in the Old Testament, God declares, "I the Lord your God am a jealous God," (Deuteronomy 5:9; 6:15; etc.). This is the Hebrew word qanna, which means simply jealous, but is only ever used of God.
Is it appropriate for God to be jealous? Consider this: God chose the Israelites because of nothing they had done (Deuteronomy 7:7-9). They were not particularly noble, nor did they voluntarily worship Him to any great degree. He blessed them, multiplied them, rescued them, and gave them a fertile land with fields and cities they did not cultivate or build. The Israelites agreed to worship, obey, and serve Him (Joshua 24). In return, they would take on the identity of God's people.
Instead, they served other idols. God invested a lot in the Israelites, and they agreed to worship Him. They owed Him their hearts. It was appropriate for Him to both want their hearts and be jealous because they rejected Him.
The jealousy of God's people for God to receive what He is owed. This word (qana in the Hebrew—1 Kings 19:14; zeloo in the Greek—2 Corinthians 11:2) is also translated eager, envious, zealous. It is used by those who serve God and see others unjustly withholding the honor owed God.
Why should we be jealous for God's glory? We are easily enough riled when someone criticizes our favorite sports team or political party. If we truly know the Creator of the universe and understand how much He has done for us, we will cringe at how horribly unjust it is for others to refuse to worship Him as well. But while this jealousy shows us the direction (toward God) and the intensity (great!) of our feelings, we are still called to respond in patience and gentleness (2 Timothy 2:24-26).
Jealousy to have what someone else has. This, of course, is how we most often define the word jealousy. It is to want what someone else possesses, whether that be a job, car, skill, spouse, etc. The first occurrence is found in Eden when the snake convinced Adam and Eve to be jealous of God's understanding of good and evil (Genesis 3:5). It spread to Cain, who killed Abel out of jealousy (Genesis 4:5), Rachel and Leah (Genesis 30:1), all the way to Paul who dealt with false teachers who were jealous of his ministry (Philippians 1:12-15).
This type of jealousy can also refer to the overwhelming desire to keep what we already have. The people who built the tower of Babel wished to stay together (Genesis 11); Joseph's brothers wanted to keep their position of prominence in the family (Acts 7:9); and Pilate was jealous for the fragile peace he had brokered with the Jewish authorities who wished to see Jesus crucified (Matthew 27).
Jesus is clear that this type of jealousy is not appropriate. In Matthew 6:25-34, Jesus tells us to not be anxious about material things. In Luke 6:30, He said, "Give to everyone who begs from you, and from one who takes away your goods do not demand them back." James 2:1-7 says not to show partiality, and Matthew 6:19-21 says we are not to seek riches on earth, but let our hearts be dedicated to more eternal treasures.
Jealousy is seen as both good and bad in the Bible. It is good to be jealous that God receives what is due Him. It is bad to envy things that do not belong to us. When we fully focus on God, "what we want" will be His glory.
What does it mean that God is a jealous God? Why is God jealous?
Why does God demand our worship?
What does it mean for Christians to be in the world but not of the world?
Does the Bible talk about self-love / loving self?
What does the Bible teach about luck?