Proverbs 21:27 The sacrifice of the wicked is abomination: how much more, when he bringeth it with a wicked mind?
The second half of this verse says that the sacrifice of the wicked that is an abomination is much more an abomination when a wicked person brings it with a wicked mind, which points to the evil intent and ungodly motives of such worship that is far more ungodly.
Because of what the second half of the verse says, we understand that the first half says that the worship of a wicked person is ungodly even when his intent, motives, etc are not wicked. Having an evil intent, therefore, is not a necessary requirement for worship to be an abomination to God.
When we study what the Bible teaches about worship, we are not automatically justified in asserting that all recorded instances of worship that God rejected had to have been because the person offering that worship had a wicked mind or an evil intent or evil motives.