Bill Gates, the Microsoft co-founder, and his wife Melinda have announced they are ending their marriage after 27 years, throwing into doubt a partnership that has remade modern philanthropy and supported one of the leading private responses to the Covid-19 pandemic.