Why is mining an important part of a digital coin?
Why mine?

Money supply

It's a way of limiting the money supply in a decentralised system. You don't want anybody to easily create new money - no-one would trust a currency where anyone can make themselves a millionaire at whim.

Most of the conventional ways of limiting money supply require a central authority who manage the printing of banknotes and their destruction and a regulatory system that prevents banks declaring that they hold more money than they actually do.

Paying for transactions

An electronic payment system consumes processing resources to validate the transactions and to make the appropriate records available to anyone who needs them. There has to be some ways to pay for this.

In a decentralised system, both transaction fees and mining are ways in which this work gets paid for.