Why did Cook name Australia Australia?

He did not. He named the part he found "New South Wales".

The name "Australia" was used occasionally before Cook's time, and popularised by Matthew Flinders from 1814, was recommended by the governor of New South Wales (Lachlan Macquarie) in 1817, and was adopted for use on (British) Admiralty charts in 1824.