Saul is focused on his relief (which is temporary). It seems to me that Saul is still focused on worldly solutions. Rather than crying out to God in true repentance and sorrow over the loss of relationship with God's Holy Spirit, Saul is desperate for temporary relief.
From God's perspective, He is placing David in the court from which he will soon rule. David will be able to witness the functioning of the royal court.
When we are focused on our selfish goals, we miss God's bigger picture and plans. We remain teachable when we are seeking God first in all things. When we humble ourselves to loving God and seeking the heart of God, He will teach us His ways and help us follow in His path.