To choose between two undesirable situations, It means one has a dilemma.
In having to choose between tax rises and benefit cuts, voters find themselves between the devil and the deep blue sea
The phrase was originally ‘Between the Devil and the deep sea’ (and some ‘the Dead Sea’ or ‘the Red Sea’). The sea turned blue much later. It seems that this idiom refers to an old nautical term that describes the seam (jointure) between a wooden ship’s deck and the ship’s side. Since this seam would have to be regularly looked after to keep the ship water-resistant, a sailor would be held in the air with ropes to seal (étanchéifier) the “devil.” He could accidentally fall in the sea or dangerously land on a hard wood deck.
Other experts see a conflict among the dates of references to “between the devil and the deep sea,” and instead posit that the phrase arose just through common belief – that on the outside of the ship was the rancorous ocean, and on the other, not safety, but just one more place where Satan, the tricky devil, would hide to cause harm
The phrase became well-known via the title of a popular song Between the Devil and the Deep Blue Sea, written by Ted Koehler and Harold Arlen, and recorded by Cab Calloway in 1931 and has since been covered by Frank Sinatra, Ella Fitzgerald, or Georges Harrison as well as by many other artists.
Other Idiomatic Expressions with the same meaning
Between a rock and a hard place
Entre le diable et la profonde mer bleue
Correct French idiom
Entre la marteau et l’enclume