I LOVE THIS TOPIC!!
God is a God of Love. God is also a God of Hate. If you love you must also hate. If you love children then you will hate abortion. God is angry with those enemies of his that practice sin. Here is a verse that describes the anger that God has towards sinners.
Hebrews 10:26-27 (NIV)
26 If we deliberately keep on sinning after we have received the
knowledge of the truth, no sacrifice for sins is left, 27 but only a
fearful expectation of judgment and of raging fire that will consume
the enemies of God.
In Numbers 25 God is specifically talking to Israel. He tells Israel that he has set them apart from the other nations. I can't find the verse right now, but God also tells the Israelites to follow specific commands regarding separation in order that Israel will remain Holy.
Leviticus 20:26 (NIV)
You are to be holy to me because I, the LORD, am holy, and I have set
you apart from the nations to be my own.
In the New Testament this author is upholding the understanding of of the Old Testament, that we should be a Holy people. But this author tells us to not associate ourselves with unholy people, instead of just killing the unholy people.
1 Corinthians 5:9-11 (NIV)
9 I wrote to you in my letter not to associate with sexually immoral
people— 10 not at all meaning the people of this world who are
immoral, or the greedy and swindlers, or idolaters. In that case you
would have to leave this world. 11 But now I am writing to you that
you must not associate with anyone who claims to be a brother or
sister[a] but is sexually immoral or greedy, an idolater or slanderer,
a drunkard or swindler. Do not even eat with such people.
God is unchanging, He does not want wicked people corrupting you. The reason that he commanded these wicked people to be killed in Numbers is because God wanted Israel to be a Holy land, a nation that could not put up with even the smallest Sins.
God does not dwell with us today like he dwelt with the Israelites, in the temple. God is teaching us how to love these days, when before He was forcing the Israelites to be Pure and Holy. Don't get me wrong we still have a responsibility to be Pure and Holy, but the land we live in is not.
In Mathew 5:39 God is talking to His obedient children, He's teaching them to forgive their enemies. A completely different context from the previous situation of holiness.
Edit: to show that God is also a God that Hates.
Psalm 5:5 (NIV)
5 The arrogant cannot stand in your presence. You hate all who do
wrong;
Psalm 7:11 (NKJV)
11 God is a just judge,
And God is angry with the wicked every day.
Psalm 11:5 (NKJV)
5 The LORD tests the righteous,
But the wicked and the one who loves violence His soul hates.
Psalm 15:4 (NKJV)
4 In whose eyes a vile person is despised,
But he honors those who fear the LORD;
He who swears to his own hurt and does not change;