For starters they didn't. The budget in late 2008 was in surplus. The 2009 budget is in deficit.
The deficit budget of 2009 is the result of a dramatic decrease in revenue (taxes). As a result of the recession, Australian businesses are earning less money and therefore paying less taxes.
The government had the option of either reducing services (hence spending less money) or borrowing money to cover the lost tax revenue. Reducing services (eg. cutting social security payments) would be hugely unpopular so they have elected to borrow the necessary money.