As suggested by Dan Bron, "you've got to crack a few eggs to make an omelette""you've got to crack a few eggs to make an omelette" may fit. We use it to imply that to achieve a purpose, something must be sacrificed. (in this case, principles, moral norms, and the like.
In order to achieve something, it is inevitable that some mistakes are made or some sacrifices occur. wikipediaWiktionary