I think it’s likely the IRS uses some kind of database of US vital statistics (including marriages) as part of efforts to detect tax fraud. Other federal agencies do, eg the State Department’s passport office uses a proprietary database called EVVE of birth and death data. [0]
[0]. https://www.naphsis.org/evve