If jealousy is a sin, why does God say He is a "jealous" God?
In the Bible, jealousy can be used in a negative, sinful sense or in a godly sense.
The sin of jealousy is envying someone for their possessions or achievements, which is sometimes called coveting. God never commits the sin of jealousy in this sense, so that is not the meaning of the word when applied to God.
The godly form of jealousy is possessing a strong, passionate desire for a righteous outcome. For example, a husband who has a loving passion for his wife is jealous for her, or a child that passionately seekings his father's time and attention has jealousy for the father, etc. That is the way God describes Himself with respect to Israel and the Church. God is jealous for us, meaning He possesses a strong, passionate desire for a righteous relationship with us.
For example, Paul uses the Greek word for jealousy in speaking about his desire for the church in Corinth:
2Cor. 11:1 I wish that you would bear with me in a little foolishness; but indeed you are bearing with me.
2Cor. 11:2 For I am jealous for you with a godly jealousy; for I betrothed you to one husband, so that to Christ I might present you as a pure virgin.
Paul refers to his zealous desire for the church in Corinth as a “godly jealousy.”
So while ungodly jealousy is a sin, because it desires something it has no right to expect, godly jealousy is an appropriate passion for what is right and true. We must distinguish between these two types of jealousies when reading scripture.