Can’t install Windows Updates after spyware removal

I had an issue where a computer wouldn’t install windows updates after I removed some spyware and viruses on it. Specifically, I couldn’t get the computer to install one of the KB packs and it blue screened during a Windows XP Service Pack 3 install (scary). Luckily, Windows reverted itself correctly to SP2. After that scare I booted into safe mode and ran SP3. Success! Now windows updates are applying successfully again.