The end doesn't justify the means.
The end justifies the means.
Both statements can be true, depending on what "ends" and "means" are in question.
A good or profitable end result doesn't justify murder, theft, or violence employed to get it. However, a life saved just might, depending on who is to be saved and who killed. Taking a completely different approach, arduous labor is often justified by material and spiritual gain afterwards.
For those who need everything spelled out in minute detail, the two statements could be worded so:
A selfish end doesn't justify wicked means.
A profitable end justifies costly means.