Trump (recently) received the nomination from his party, while Biden dropped out before the DNC. I could be wrong but I think it’s a little more problematic for him to drop out, although perhaps that’s just related to RNC self-imposed rules and not any actual laws.