David understood and believed in the God-given principle of the sanctity of life. God's law stated that "the life is in the blood", which was why God required the blood of killed animals to be poured out on the ground and never drunk. Nor was meat that had not been bled properly to be eaten. Life belongs to God, and the symbol for life being blood, then blood belongs to God.
This injunction long preceded the Mosaic law. It was stated in God's covenant with Noah after he and all in the ark disembarked. Noah sacrificed clean animals and birds on an altar to thank God for his deliverance (Genesis 8:20). God then gave Noah permission to eat animal flesh.
"But flesh with the life thereof, which is the blood thereof, shall ye
ot eat. And surely your blood of your lives will I require; at the
hand of every beast will I require it, and at the hand of man; t the
hand of every man's brother will I require the life of man. Whoso
sheddeth man's blood, by man shall his blood be shed: for in the image
of God made he man" (Genesis 9:3-6).
King David knew all of this and realised that he had foolishly expressed a desire that put the lives of those three mighty men at unnecessary risk. There was water in the camp, but he developed a longing for water drawn from the well at Bethlehem. Those three men risked their lives to fight through to the well, to draw that water and return. David realised he needed to repent for his weakness and foolishness. As Matthew Henry puts it:
"He would not gratify a foolish fancy. He that has such a rule as this
over his own spirit is better than the mighty... Devotion towards God.
That water which he thought too good, too precious for his own
drinking, he poured out to the Lord for a drink offering. If we have
anything better than another, let God be honoured with it, who is the
best and should have the best... It is honourable of great men not to
be prodigal of the blood of those they employ, but, in all the
commands they give to them, to put their own souls into their souls'
stead." (p 441, 3rd column)
Such is the outworking of the principle of the sanctity of God-given life exemplified by King David. To him, it represented the blood of men who could have died in order to bring mere water to him, for his enjoyment (not because he would have died without that particular water). Therefore, he could not drink it, for - to him - it had symbolically become blood. He poured it out as a drink offering to God, on the ground, as the law stipulated.