Daniel 1:10 (ESV)

10 and the chief of the eunuchs said to Daniel, “I fear my lord the king, who assigned your food and your drink; for why should he see that you were in worse condition than the youths who are of your own age? So you would endanger my head with the king.”

The fact that the Lord gave Daniel favour and compassion in the sight of Ashpenaz does not however mean that he grants the four boys their wish. Out of fear of the king, he does not give the requested exception. He is afraid that after a while these four will not appear as healthy as the others and that he will be blamed for this. Ashpenaz knows the king and how strict he can be. It is not impossible that Ashpenaz would receive the death penalty if things do not turn out well. Therefore, he does not give Daniel and his friends the requested permission.