It might be cheaper foor a business to just not hire Australians than to hire a lawyer and dedicate bizdev time to figuring out the intricacies and nuance
It is not cheaper than getting sued for discrimination. Which would be easily proven in many cases, seeing how many people are more afraid of a potential issue with another country's intelligence agencies then of publicly posting about their plans to violate their own employment laws.
You're bringing up an valid exception validated by law. It's not the default and does not apply to almost all jobs out there. It's also usually applied as "only our nationals" rather than "not those specific other nationals" which would be the case for non-Australian.
I'm not linking specific cases. (partially because you didn't specify which country you're taking any) A quick Google will bring you the specific laws, cases and lots of lawyers specifically advertising themselves to handle those cases.
You can’t be sued for discrimination based on the employees location, which is actually the issue at stake here. Citizenship doesn’t appear to be relevant.
Later posts make it clear the law is actually about country, not citizenship. Non-citizen residents of Australia have the same risk factor as citizens.