
Do, mean, etc. something for the best
Good Intentions
The phrase implies the person is trying to help, even if the actions might not be favorable to everyone. 
Unintended Results
Understand that actions done for the best may still lead to unexpected, sometimes negative, consequences. 
Hindsight Explanation
It's often used to justify a decision after the outcome is known, regardless if it was good or bad. 