He's so stupid to have done that. = Doing that was a very stupid thing for him to do.
He's so stupid [that] he did that. = He is such a stupid person that he did that. (He's so stupid that when he read "twist to open" he thought he had to dance.)
Winston Churchill was esteemed for his mastery of the English language. One time he ended a sentence in a preposition and there was an article in the newspaper about it. He was then interviewed by a reporter to respond to this. Churchill responded by saying "Ending a sentence with a preposition is something up with which I shall not put."