Which phrase has a more negative connotation

It depends on the individual's perception, but generally speaking, a phrase with a more negative connotation would be "a necessary evil" as it implies that something unpleasant or harmful is required for a particular purpose.