It would not be standard, but it would be something people say either because it is local or personal idiom or because they switch mentally from "Why … ?" to "What … for?" partway through speaking.
The song tells a story. Is telling a story about people who don't speak standard English without any slips wrong?
(Assuming that it is in fact that rather than a transcription error).
On a related note, the time signature of some early published versions (which don't have that line at all, if I recall correctly) were marked as to be played in the tempo Loesserando, which isn't a standard musical tempo but a play on the composer's name. Does that count as "wrong" or as brilliant?