Here’s my take. It was a test of faith, a la Abraham and Isaac. Locke had to sacrifice his own son (Boone) to get the key to the hatch. In fact, Locke referred to Boone as “son” in one scene. Locke also knew Boone was going to get hurt in their outing because of his dream, but yet he never mentioned this to Boone so he would still come along. Also, the heroin from the plane wreck sets up a future episode where Charlie heads into the jungle to get the smack back.