HR will use the information to ensure the two are not subordinate to one another. Example: A is dating B at the same company. HR will make sure that A is not subordinate to B and vice versa. This will reduce conflict of interest.
That said, Kimberly Powell (former Vice President of Healthcare at Nvidia), reported directly to Jensen Huang. That is a big no-no, probably enough to be demoted and/or fired, especially as CEO.