Microsoft Corp. board members decided that Bill Gates needed to step down from its board in 2020 as they pursued an investigation into the billionaire’s prior romantic relationship with a female Microsoft employee that was deemed inappropriate, people familiar with the matter said.