This story teaches us the importance of listening carefully to the voice of God because God does not see as we see, we look on the outward appearance while He looks at the heart, so we need Him to speak and guide us as to what His will is.Most of the time in the physical it looks obvious what we need to do but God says in His word His ways are not our ways and so to get the full picture we need to see things spiritually and we can do this only by His Spirit.
Mostly we are led by the flesh, what we can see, feel and touch, but this only helps to blind us spiritually.
God is teaching us to discern by teaching us to listen to the Holy Spirit and to base our judgement on this rather than on our natural insticts.
We learn to hear from the Spirit by patience and trust in God. Patience because we have to wait upon God and not to go on ahead of him and trust because we have to trust and believe that He knows and will do what is best for us no matter what. We know it is the Spirit of God if what the voice speaking to us is telling us correponds to the word of God and if we have peace with God about it.