Spain signed off from a forgettable campaign in style by beating Australia 3-0 in a battle for pride, with David Villa decorating his final international with a wonder goal.