Speaking to Oliver Cowdery, the Lord said:
D&C 17:5 And ye shall testify that you have seen them, even as my servant Joseph Smith, Jun., has seen them; for it is by my power that he has seen them, and it is because he had faith.
Joseph Smith was not chosen at random for the first vision. He received the things he received because he had the faith to receive them.
Ether 12:19 And there were many whose faith was so exceedingly strong, even before Christ came, who could not be kept from within the veil, but truly saw with their eyes the things which they had beheld with an eye of faith, and they were glad.
In fact, we learn from the scriptures:
D&C 130:20 There is a law, irrevocably decreed in heaven before the foundations of this world, upon which all blessings are predicated—
21 And when we obtain any blessing from God, it is by obedience to that law upon which it is predicated.
Thus Joseph Smith received whatever spiritual blessings he received from God by obedience to the law upon which those blessings where predicated. For no man receives any blessing from God on any other terms.
Praise to the man whose faith could allow him to come into the presence of God even while growing up in a day of apostasy.