Daniel’s enemies sought to find ways to harm him because they were jealous of his relationship with the King. God gave Daniel favor in sight of the King. Daniel’s ability and honesty threatened them.
The way he gave thanks and petitioned his God was the fault they found. They tricked the king into passing a law forbidding him to pray to his God.