I agree with you that it is a mistake to declare that the lack of women in tech and software professions is solely due to sexism. As you rightly point out, women deal with sexism in many industries and spheres of life.
However, sexism is a part of the western social fabric. Women that do or do not want to pursue work will invariably find themselves in sexist encounters and situations. Also, industries like finance and advertising have a problem with women being represented in management, esp. at the highest levels due to institutional sexism and discrimination. We already see women leave fields due to those kinds of pressures and treatment, so to paint a picture of those industries being full of well treated women is disingenuous.