They had killed everyone on their Earth and they were threatening to find his universe and repeat their atrocity. Superman was the lone representative of that now-dead world. So he acted as their executioner. He executed them as punishment, and prevention from them finding his universe and repeating their atrocity on his Earth.
Superman creator Jerry Siegel had the Golden Age Superman kill villains as well in some cases while Siegel still had creative control of Superman. That was only changed because an Editorial Advisory Board was created by DC editorial director Whitney Ellsworth in Octobor, 1941. DC's Editorial Board was replaced with the creation of the Comics Code Authority in 1954.
This is from the transcript of the 1954 Senate hearings showing the editorial policy restrictions that every DC writer and artist had to follow from 1941 to 1954:
EDITORIAL POLICY FOR SUPERMAN D─C PUBLICATIONS
1. Sex. ─ The inclusion of females in stories is specifically discouraged. Women, when used in plot structure, should be secondary in importance, and should be drawn realistically, without exaggeration of feminine physical qualities.
2. Language. ─ Expessions having reference to the Deity are forbidden. Heroes and other "good” persons must use basically good English, through some slang and other colloquialism may be judiciously employed. Poor grammar is used only by crooks and villains ─ and not always by them.
3. Bloodshed. ─ Characters ─ even villains ─ should never be shown bleeding. No character should be shown being stabbed or shot or otherwise assaulted so that the sanguinary result is visible. Acts of mayhem are specifically forbidden. The picturization of dead bodies is forbidden.
4. Torture. ─ The use of chains, whips, or other such devices is forbidden. Anything having a sexual or sadistic implication is forbidden.
5. Kidnaping. ─ The kidnaping of children is specifically forbidden. The kidnaping of women is discouraged, and must never have any sexual implication.
6. Killing. ─ Heroes should never kill a villain, regardless of the depth of the villainy. The villain, If he is to die, should do so as the result of his own evil machinations. A specific exception may be made in the case of duly constituted officers of the law. The use of lethal weapons by women ─ even villainous women ─ is discouraged.
7.Crime. ─ Crime should be depicted in all cases as sordid and unpleasant. Crime and criminals must never be glamorized. All stories must be written and depicted from the angle of the law ─ never the reverse. Justice must triumph in every case.
In general, the policy of Superman D─C Publications is to provide interesting, dramatic, and reasonably exciting entertainment without having recourse to such artificial devices as the use of exaggerated physical manifestations of sex, sexual situations, or situations in which violence is emphasized sadistically. Good people should be good, and bad people bad, without middle ground shading. Good people need not be "stuffy" to be good, but bad people should not be excused. Heroes should act within the law, and for the law.