One thing we must never forget is the fact that God loves us and He means the best for all in all situations. Just as a good Father with perfect foreknowledge He tried to guide us away from danger.
Our myopic nature however does block our perception of His dealings. Yet if God loves you, He will check you and discipline you. The Bible says that such corrective discipline by God is proof of our sonship (Hebrews 12:6-11).