What is the difference between "The army didn't have any" and "didn't have no" in "It makes a fellow proud to be a soldier"?

Solution 1:

It is a dig at the alleged low intelligence of the military personnel. Throughout that song there are sideswipes at the military in general.

Examples:
He couldn't tell a shelter half from an entrenching tool
He comes from Georgia, so doesn't speak the language very well
It is written in the stars he will get his Captain's bars, but he doesn't have enough box tops yet

There are other examples of dislike of the military in Lehrer's work. He talks of his time working with The office of Naval contemplation and the Air Force having its equivalent Up in the air junior birdman song.

It is simply a reference to the alleged use of the ungrammatical Don't have no instead of Doesn't have any by the poorly educated.

The military is not the only group of people depicted as uneducated by Tom Lehrer. A form of comedy that was common then but is not considered to be politically correct nowadays. Consider his song "I want to go back to Dixie" which he describes as The land of the Boll Weevil, where the laws are mediaeval. I could go on.

Solution 2:

The other answers are correct, but they (and the OP) are missing an important piece of context: the first part of the quoted sentence. The full introduction to the song runs as follows:

I have only comparatively recently emerged from the United States Army, so that I am now of course in the Radioactive Reserve. And the usual jokes about the Army aside, one of the many fine things one has to admit is the way that the Army has carried the American democratic ideal to its logical conclusion, in the sense that not only do they prohibit discrimination on the grounds of race, creed, and color, but also on the grounds of ability. [laughter, applause break]

Be that as it may some of you may recall the publicity a few years ago attendant on the Army's search for an official Army song, to be the counterpart of the Navy's "Anchors Aweigh" and the Air Force's "Up in the Air, Junior Birdmen" song. I, um -- I was in Basic Training at the time, and I recall our Platoon Sergeant, who was an unfrocked Marine -- actually the change of service had come as quite a blow to him, as it meant that he had to memorize a new serial number, which took up most of his time [applause & laughter break] -- at any rate, I recall this Sergeant informing me and my -- roommates -- of this rather deplorable fact, that the Army didn't have any -- excuse me -- "didn't have no official song".

The context, in other words, is that he is making fun of the intelligence of his Platoon Sergeant, who (evidently) attained his rank despite a lack of ability and was not particularly smart. "Didn't have any" is grammatically correct, but an incorrect quotation; "didn't have no" is "correct" in the sense that it faithfully reproduces the Sergeant's words as they were originally spoken, i.e., in a grammatically incorrect way.