Etymology Online says that the phrase “man of straw” was first used to describe an imaginary opponent in the 1620s.
Here's one of the earliest examples I could find in a Google Books search of the phrase “straw man" being used in the context of a debate. It's in a periodical called
The Chroniclepublished in 1878 by the students of the University of Michigan, and the anonymous author appears to be quoting another article from 1875, which is earlier than the citations for this kind of use that are shown in Merriam-Webster and the Oxford English Dictionary:
“The average debater knows no finer fun than belaboring a man of straw. How often have we heard that ambitious disputant, in full flush of victory, fashion with his creative tongue that silliest of all fools—the straw man. Into the straw man’s mouth are put impossible propositions, and when he has been made to utter them, the speaker proper proceeds to show what an utter a** this straw man is.”
It’s possible that the phrase originated even earlier, but it looks like the name really does come from the idea of propping up an imaginary man of straw or scarecrow as a ridiculous opponent who would be easy to defeat.