It's an interesting set of stories in today's reading. When I encounter stories like what happened in the text today in the way they were recorded, I find myself asking questions like, "Why did the Lord respond this way?" and, "Why did that happen like it did?"
Moses strikes the rock instead of speaks to it. No Promised Land for you (in your best Seinfeld-soup-nazi voice).
Balaam goes at the Lord's bidding but finds himself on the other side of a really ticked off messenger from God.
So why did it unfold like that?
At moments like this in the text, all I can do is make some inferences about what happened but is not recorded. I know the character of God. He's not capricious or lacking intention.
Moses strikes the rock instead of speaking to it at a key time in the leadership of Israel. My inference? God doesn't want His leaders angry at His people, especially during crucial times. And this wasn't the first time that Moses had been angry. And it wasn't the first time it had cost him and the people who were following him.
Balaam goes with Balak's envoys at the Lord's bidding and meets the angry angel. My inference? Balaam might have been looking forward to the *ahem* honor that Balak was willing to bestow on him. Balaam was willing to go and speak whatever he was told. But a little moolah on the side isn't a bad deal if you're a prophet (who weren't necessarily known for having the easiest of lives). God reinforces His terms with Balaam: you say what I tell you to say.
The Bible is always clear enough that we can understand it. We just might have to use our brains sometimes to get there, reading more than just the words on the page. There is context. There is an understanding of God. There is an unfolding of a story. All of that has to come into play.