There is no route out for water
A mattress core is enclosed. Water driven into foam or fibre in the middle of a mattress has no path to the surface except slow evaporation through the layers above it, and that can take days. During those days the core is warm, damp and enclosed, which is precisely the environment mould needs. Once it establishes inside a mattress there is no cleaning process that reaches it, and the mattress is finished.