Have you given this thought? Sure, Barney's actions regarding stealing Marshall's date turn out to be more well-intentioned than we originally believed, but they're still far from ideal because they essentially force a decision on Marshall--to get back with Lilly or be single indefinitely.
Sure, Lilly and Marshall end up together, making us somewhat forgive Barney for wanting them to pair back up, but they almost didn't, and had either of them chosen not to rekindle things, Barney was very possibly sabotaging Marshall's new life (and happiness) without consent. That's definitely not how I'd want my friends to show support for me after a breakup; Robin herself (the woman who married Barney) admits that she has doubts about him because even his "good" actions revolve around deception (like his proposal to her).
As for the painting, I very much doubt Barney didn't derive pleasure from having his friend's wife (who he flirts with constantly) perform the act, but even if you're right, that's a small defense that doesn't excuse the other transgressions.