First things first: it's unlikely that this is connected to the Salvadorean civil war, if it's from the 1960s: the civil war didn't start until 1979, seven years after Hoover's death — and in any event, Hoover's involvement in US foreign policy was fairly limited.
The intended implication of the "Hoover sleeps with a night-light" joke was to impugn his masculinity (a common angle of attack for Hoover's detractors, given longstanding rumours even during his lifetime about his sexual orientation), or suggest that he was a paranoid coward.
But it's difficult to pin down where the joke originates: I found a light-hearted passing reference in a 1971 speech Hoover gave to the American Newspaper Women's Club. Hoover accuses unnamed tabloid journalists of going through his trash, and gripes about "a syndicated columnist who has managed to set up a full-time garbage-sorting concession on the sidewalk outside my house":
[...] despite what those who scavenge through my garbage say, I want you to know that I don't suffer from either heartburn or gastric acidity.
There is another matter which I feel compelled to mention at this time, one which has been of increasing concern to me and my associates in the FBI... As you know, it has been alleged that I sleep with a night-light... This is absolute nonsense... The fact of the matter is, I have been sitting up night after night waiting for one of those famed late-evening telephone calls from the lovely cabinet wife whom you are honoring tonight [Martha Mitchell, wife of then-Attorney General John Mitchell].
Hoover was referring to prolific Washington Post investigative columnist Jack Anderson, an avowed enemy of the Nixon administration who also turned his sights on Hoover, tasking reporters to steal his household waste in order to make a point about FBI surveillance of US citizens. In a March 1971 column headlined 'Hoover's Trash Shows He's Human', Anderson wrote:
We have discovered that FBI chief J. Edgar Hoover, behind his stern visage, is as human as the rest of us. He suffers from indigestion, brushes his teeth with Ultra Brite toothpaste and drinks Irish Mist after dinner.
We found the evidence, frankly, in his trash. We had decided that the 76-year-old G-man should be subjected to some of the same investigative practices he has been using on so many others. In FBI fashion, therefore, we have been tailing him, questioning his neighbors and inspecting his trash.
The 'night light' quip doesn't appear to originate with Anderson, however. You find passing references in articles about Jack Clouser, an armed robber known as the 'Florida Fox' and a long-time member of the FBI's Ten Most Wanted List. From a 1974 article in the San Francisco Examiner:
After a little digging, Mrs. Simons discovered a long story about the Florida Fox in a 1972 detective magazine. In it was an anecdote she believes may have led to the FBI keeping her husband on its wanted list so long.
"He apparently wrote a lot of letters to the FBI," she said. "In one, he supposedly said (then) FBI director (J. Edgar) Hoover sleeps with a night light on and with a teddy bear."
Such a taunt — which authorities said led to his being tagged the Florida Fox — might have earned the fugitive a special place in the late FBI director's mind, she said."
But you also find references elsewhere, suggesting it was a popular joke that could commonly be found as graffiti, bumper stickers, badges and protest placards in the 1960s. It crops up in a list in a 1967 column about graffiti by humorist Art Buchwald; in 1970, Montreal Gazette journalist George Brimmell apparently saw it scrawled on the wall of a Los Angeles washroom; in a 1971 Robert Reisner book about graffiti, it's credited as being spotted at the "Horn and Hardart Automat, New York City. Also a button message."
In all likelihood, it's impossible to find the original source of the saying — by the time of his death, Hoover had been a high-profile and deeply unpopular figure for decades, and the 'night light' joke likely just caught on organically and entered the zeitgeist as a way to skewer a man widely seen as a sinister force in American life.
Edit: fixed typos, corrected date of Salvadorean civil war (thanks /u/FrancisReed!)