For an act to be deemed good in the eyes of the Lord it must be
1)In accordance with God's will
2)done with the intent of doing god's will
So while the intent is important to sacralize the action… The action itself must be approved by God and especially its logical results.
This is why the left and humanists aren't doing "good" by any means even if they have good intentions… Because they're doing evil.
And this is why satan will be punished… Because even if his actions ultimately serve God's plan… he's not doing them to serve God.