As the employee with more power and rank at the company in question, David should have been the one to be forced to leave the department. That would have been the moral thing to do.
Company's interest is most often not a question a moral, but efficiency.
This train of thought has a lot of similarity to the discussions going on around corporations maximizing only share-holder value, or if it is better for them to include stakeholders, and other non-stock-price factors when making decisions.
Rules against nepotism in companies are there to prevent people in a personal relationship from giving their partner an unfair advantage over other employees, but also to prevent higher-ups from using their power within the workplace to victimize their subordinates. In either case, when a pair of employees clearly and willfully violates the policy to the level of having a kid together, I think the company should assume that the higher ranking person is more culpable, and should be punished for their actions, not the other way around.