"Brain washing" did not originally have a negative connotation
A clickbait title gives a little insight:
By New Process of Brain Washing, Drug Habit Is Cured in Six Days
This is from The Democrat and Chronicle, 1932. This is one of several citations given by Merriam Webster for the expression in the 1930s. Notably, all of these are positive usages:
He could begin with brain washing. Every brain, male or female, needs a good cleaning every now and then.
— The Manhattan Mercury (Manhattan, KS), 18 Jan. 1934
The most dramatic part of the exhibit is a motion picture of a boy cured completely in four days of St. Vitus dance, which at the start of treatment made him unable to talk. One arm was paralyzed and the rest of his body twisting and twitching. Two brain washings effected the cure.
— The Montgomery Advertiser (Montgomery, AL), 10 Jun. 1935
Merriam Webster notes that early in the century, "brains would sometimes be washed, generally as part of a cure for an illness" but not so much that this could be considered a fixed expression.
The current sense comes from Chinese in the 50s
The expression as we know it today is a translation of "xǐ nǎo" (from Bejing dialect). MW's first citation is:
China Under Red Flag-IV. “Brain-Washing”—A New Version Of the Mental Purge
This is what Chinese papers graphically term “washing one’s brains,” or “laying one’s heart on the table.” There was a case of a school teacher in a small town between Shanghai and Nanking who was summoned to a “brain-wash” before a large audience, partly consisting of his pupils. When asked to speak he confessed his sins for some ten minutes, and then stopped for lack of more ideas. He was begged not to be so brief. And was then forced to go over his mea culpa for some two hours.
— The Times of India (Mumbai, Ind.), 23 Jan. 1950
I'm not sure who wrote that. Edward Hunter is credited, however, with popularizing it (if not the one to bring it to English in the first place) starting with his September 1950 article in the Miami Daily News titled "Brain-washing Tactics Force Chinese Into Ranks of Communist Party" which is mentioned by the Smithsonian Magazine. He also wrote a book, which I found neatly summarized in the Indianapolis Times from November 1951:
Edward Hunter explains some of the methods of the Reds in destroying the minds of men in BRAIN-WASHING IN RED CHINA (Vanguard. $3.50). What is behind the "confessions” of the innocent?" How may an innocent man be made to confess to activities in which he did not participate? The author says that the Reds have attempted to place an entire people under hypnotic control and that the experiment is too successful for comfort. The Chinese call the method "brain-washing."
I also found this snippet from the 1907 New York Tribune, though it looks like an unrelated one-off probably spurred by the context:
Let the slumbering slums of New York get wind of the great bathtub contest; let San Francisco's new Chinatown hear that its reputation is at stake, let the Buffalo waterfront and a few other distinguished places learn that the American Athens is trying to add a hygienic sprig to its crown of laurel, and then the war will be on and the limerick or brain washing contest will lapse. And it will be well, for it is nobler by far to encourage water in the tub than water on the brain.
And another newspaper clipping (1911; reprinted as late as 1919 with minor changes), too brief to say much:
Chemistry has given us many a face wash, but the world still waits in vain
for a successful brain wash.