Date codes (and sometimes batch codes which are usually on the packaging) are important for traceability both for the device manufacturer and the customer.
In safety critical applications (such as flight controls) the date and (if available) batch code of every possible component is recorded against the serial number of the PCB they are fitted on and which final assembly contains that PCB.
If a set of similar failures occur sooner than expected (yes, we expect the boxes to fail at some point) then batch issues become a prime suspect; we don't really care just how the date code or batch code has been stated provided full traceability can be established.
The high reliability industries typically buy components from relatively few suppliers (distributors in particular) for this very reason; I have seen batch failure issues a couple of years post manufacture (but where the expected MTBF was expected to be 5 years or more) and when that can be proved, the supplier is always informed. It is then up to them to see if a part of that overall batch was sold to another customer and inform them of a (now) known reliability issue.
They will also inform the device manufacturer who may (or may not depending on the manufacturer) investigate the cause of the failure. It is in the interest of the manufacturer to do this both for their own quality assurance purposes and the confidence of the equipment manufacturers in their parts.
As many manufacturers have numerous fabrication plants scattered across the globe, knowing the date and batch codes (which often has a code for the plant where the device was manufactured), it also helps them understand which plants may need a bit of attention.
So a primary underlying purpose is traceability.
The reason that relatively few distributors are used is that traceability costs money and requires systems to be set up to perform the necessary tasks (such as storing the data and holding that data for extended periods of time); to cover those extra costs to the distributor, the parts have a (small) premium on the price. The manufacturers typically bring this back down by doing large amounts of business with distributors that can meet the traceability requirements (of which there are not really that many).
Note that for companies where such traceability is required, the cost of managing the supply chain is quite high; the more suppliers they have, the more it costs so agreements are usually put in place with a few key suppliers; if they cannot source parts, then a certified broker needs to be used.
As noted by The Photon (in the comments) date codes can be a very useful troubleshooting aid, particularly for 'picky circuits'.