Hebrews 4:1 - 16
NKJV - 1 Therefore, since a promise remains of entering His rest, let us fear lest any of you seem to have come short of it. 2 For indeed the gospel was preached to us as well as to them; but the word which they heard did not profit them, not being mixed with faith in those who heard it.
For follow-up discussion and general commentary on the topic. Comments are sorted chronologically.
I believe that God did what was right. We as Christians should look at that passage and know that God wanted them to have that land, but because of the discouragement, they lost faith and the promised land that God was going to give them and even their lives. They should have obeyed God instead of disobeying God. Had they obeyed things would have been different. They would have been able to have the promised land, enter it, and have complete joy and rest from all that they had been through. God was providing for them, but all they did was complain, so God punished them. They chose to disobey, so therefore they chose to die.