Despite the lessons from DC-10 planes in 70s, why didn't Boeing ensure their cargo doors didn't fail even until the end of the 80s?
Most probably because the failure modes were very different. In the DC-10 case the door could appear closed even though the locking mechanism was not properly engaged. On 747 that was not a problem; instead the electric motors opening the door had enough power to break the locking mechanism if electric power somehow made it around the switch that was part of the locking mechanism.

And then, 2 years are not really enough to analyse a problem like this, develop a fix, test it and deploy it. The NTSB investigations alone often take longer than 2 years.