Daniel was favored by God because he obey God and had a good heart and desired to do things right and do what was right in the sight of God.

Daniel 6:3 Then this Daniel was preferred above the presidents and princes, because an excellent spirit was in him; and the king thought to set him over the whole realm. Daniel 6:4 Then the presidents and princes sought to find occasion against Daniel concerning the kingdom; but they could find none occasion nor fault; forasmuch as he was faithful, neither was there any error or fault found in him. Daniel 6:5 Then said these men, We shall not find any occasion against this Daniel, except we find it against him concerning the law of his God.