Waterproofing is a spectrum (https://support.apple.com/en-us/HT207043), and seals fail over time. The fewer holes from the outside of the device to the inside, the fewer points of failure for the waterproofing. It was an openly stated reason for the move, and the first Apple phones to ditch the jack were the first to hit IP67 as a result.