The mining work is used to prove that a certain amount of computational 'work' was done. This work takes a predictable amount of time (in aggregate), and because of that, it can be used as a way to timestamp transactions in a globally serializable way, even in the face of malicious adversaries.
Consider a block chaining system without proof of work: I want to send some bitcoin so I broadcast a signed message to the network saying "send 10 bitcoin to dandare". But let's say I also send another message to the network saying "send 10 bitcoin to <my other address>" at the exact same time.
Now what happens is the chain forks. Some people consider transaction #1 canonical and some people consider transaction #2 canonical, but they can't both go in the same chain because they conflict. So now your blockchain has a split at the end of it, how do you decide which one is the real one?
Well, everyone in the network is incentivized to add their transactions to the 'real' chain, because obviously everyone wants their own transactions to be real. So if either chain gets a small edge in 'realness' everyone will pile into that one, looking out for their own self-interest.
In the absence of proof of work, no chain ever becomes any more 'real' than any other, because there is no effort in adding to the chain. Me with just my laptop can keep extending the one that I want to win indefinitely, and roughly 50% of the time it'll come out how I want.
Proof of work solves this, by making the network 'invest' computational effort to extend a chain. Because it takes enormous computational resources, no single actor can significantly or reliably influence which chain is going to win. And as each additional block is chained on after the one containing a given transaction, it becomes exponentially more difficult for another 'side chain' to catch up.
This means that if you wait until about 3 blocks after the transaction I sent you, you can have a very high degree of confidence that the chain you are looking at is and always will be the canonical bitcoin blockchain. In order for that to become untrue, someone would have to find two consecutive solutions to the proof of work problem in the same time it takes the entire bitcoin network to find 1.