The October 1941 edition of American Speech (vol XVI, no 3) carried a "Glossary of Army Slang", including:
EGG IN YOUR BEER. Too much of a good thing.
The earliest use I found was by PFC. George H. Willers of the US Marine Corps in a letter to Life magazine (8th September 1941):
Just what the hell do they want — eggs in their beer? The undersigned, a marine, "goes out to sea in ships" and is only too glad to get ashore once a month or so, even though it may not be these blessed shores, to places where the beer is lukewarm, where ice cream comes from a cow by way of a powdered-milk can, and the food in restaurants looks like it has been eaten before.
The American Heritage Dictionary of Idioms says:
This expression dates from about 1940 and became widespread during World War II. The origin is unknown, since adding egg to beer does not improve the taste.
A December 1946 American Speech (vol XXI, no 4) includes 'Army Speech in the European Theater’ by Joseph W. Bishop, Jr.:
“Whaddya want—an egg in your beer?" Properly, this is the retort courteous to a gripe, or bitch, which is not fully justified. By loose usage, it has become an answer to any and all complaints. I do not know its etymology, but my assumption has always been that it is based on the fact that fresh eggs and real beer were two of the scarcest desiderata in the ETO [European Theater of Operations], the possession of one of which ought to have sufficed any man. There is some evidence that it has been prevalent around Brooklyn for years, but at any rate it has had wider currency in the Army than ever before and has been more apt.”
Dewdroppers, Waldos, and Slackers: A Decade-by-Decade Guide to the Vanishing Vocabulary of the Twentieth Century (2003) by Rosemarie Ostler lists it under the forties:
egg in your beer: too much of a good thing. What do you want, egg in your beer? was a common retort to pointless or unjustified complaining since in the wartime world either an egg or a glass of beer alone should have been a sufficient luxury for anybody.
The Facts on File dictionary of clichés suggests it could be an aphrodisiac, and mentions an 1883 recipe containing egg white and mead, but says these rare recipes are probably unrelated to the saying, and that it "is presumably viewed as some kind of enrichment".
Eric Partridge's A Dictionary of Catch Phrases (1986):
what do you (or, illiterately yet frequently, whaddya) want? eggs (or an egg) in your beer? 'Usually said to be someone who is bitching or griping without justifiable cause. I have heard this used only by Marines, but I strongly suspect that it was borrowed from civilian use' (Col. Moe 1975). Therefore, tentatively: C20; civilian become, during WW2, Marine Corps.
'I heard this first in 1937, (as ...egg...) and in a civilian context. Certainly it has been in general (not just USMC) use since then' (R.C., 1978). A shorter var. is you want an egg in your beer?; cf what do you want? Jam on it?
Real egg in real beer
A preview from a (probable 1915) Catering industry employee: Volume 24 reports on a Seattle court case on whether egg-in-beer is food or a drink:
EC Maddox, another witness for the city, asserted he paid a nickel and received an egg in his beer. On the stand, in his own behalf, Aronson averred that egg-in-beer is one of the oldest combinations known to mixologists.
Von Ziemssen's Handbook of General Therapeutics (1885) lists "Warm beer with egg" and Practical Druggist and Pharmaceutical Review of Reviews lists "Root Beer with Egg".
The Archives of Pediatrics (1916) says with surprise:
Other foods recommended were French bread, hashed meats, and, last but not least, small beer with egg yolks beaten in ! ! !
A 19th century The Pet-Stock, Pigeon, and Poultry Bulletin says:
It is an old-fashioned recipe to clear warm beer with egg shells, and coffee with the yelk of an egg, and the clearing properties of the yelk of an egg seems to have been known to the Romans...
So, who's going to test it out and crack an egg into their beer this weekend?