You can hyphenate ragged lines, too. And that’s not frowned upon by typographers (at least not by all of them). https://practicaltypography.com/hyphenation.html:
”In left-aligned text, hyphenation evens the irregular right edge of the text, called the rag.”
Justification makes sense when you can hyphenate words, that way you can pack more letters, otherwise the whole word would break into the next line.