Microsoft had the great misfortune of being the dominate computing platform in the 90's and early 00's. Computers just weren't as reliable or easy to use back then. Maybe Microsoft could have made Windows better back then, maybe not. Mac System 7/8/9 was by all accounts less reliable than windows and anything 'nix would have been unthinkable to a typical user.
So just about everyone has had a crapware infested computer running something like windows ME or Vista that crashed every few hours. For many people, the first non-widows computer they used was an android or iOS phone. Therefore the association is Microsoft == crappy/unreliable vs Apple/Google == easy to use/dependable. OEMs in a race to the bottom on hardware don't help Microsoft at all.
I actually think windows 7 was a rock solid OS and Windows 8 is good once you get over the awkward interface changes. But Microsoft's brand image has been permanently damaged.