I wouldn't call being a teacher more prestigious than being an engineer, nor a social worker, but there are still a lot of women who are more interested in going into those fields than into engineering disciplines.
Other studies also point to other reasons; in computer science especially, there's a very strong effect of computers being seen as boys toys, so men come into the major with more experience and more interest in the field just to begin with: <https://www.cs.cmu.edu/afs/cs/project/gendergap/www/papers/s...
The gender gap in engineering disciplines, as a complex social phenomenon, is likely to have many interrelated causes. Between lower encouragement of computers as girls toys at younger ages, the fact that there is still a bit of an expectation that men will be the primary breadwinner in the family and thus women can get these lower paying but more rewarding jobs, the fact that the large existing gender gap makes it less comfortable for women in the major, in the workplace, and so on, it's unlikely that there's going to be one single cause for it.
So, in summary, while from what I found it looks like it's not prestige but how rewarding the job is perceived to be that makes more of the difference, but that's not to say that your hypothesis is wrong, just that I found some evidence to support a different effect that at least appears to be stronger than the effect you describe.