While it’s an engineering marvel no one thought that it would last only 90 days if it successfully landed and deployed, the 90 days was a minimum figure for the design and also the initial operating budget for the mission.
It's really hard to engineer something that will last 90 days. It's much easier to overbuilld it, which fulfills the requirement of 90 days.
It was designed to last as long as possible within the given weight and size budget.
The 90 day figure is simply the time period for which NASA asked for money to operate the thing no one is going to ask for 2, 5 not to mention 15 years worth of operating budget you usually get a few months at the time and extend it based on your needs.
Turns out the panels clean themselves with enough wind.
At the time the MER vehicles were built we knew enough about Martian dust to know that it would be a severe limiting factor on solar powered vehicles, but we didn't have enough experience with long lived solar powered vehicles to know all the details. We didn't know about "cleaning events" which were too irregular to fully plan for anyway. Ultimately, we got lucky, and we were able to take advantage of that luck on the fly. For example, we found that even with heavy dust accumulation the rovers could survive with careful power management during Summer, and during Winter we could conveniently park them on a South facing incline to maximize power.
Nevertheless, it is telling that for both rovers the thing that did them in was the thing that was always expected to limit their longevity: solar power generation. Spirit had a wheel get stuck and then couldn't park at a good angle during winter, and the absence of cleaning events during that time resulted in power generation falling below a critical threshold at that time. Opportunity got done in by an epic planet wide dust storm, which blocked sunlight long enough for the batteries to run out and for the vehicle to get dangerously cold (likely resulting in critical equipment failures).
Before we had that experience we had no idea that these things were possible, and nobody in their right mind would have bet money that the rovers would have been able to survive for years on Mars.