Some people would say it's because He wants to test us.
-----
Not to be provocative, but would "some people" consider their parents' instruction not to play in the street as a test?
Yes, they might. In fact, most probably do. I mean, that's the most comfortable and facile interpretation.