They can’t go anywhere they want. They have no resources to leave before their asylum applications are processed, and if they’re granted refugee status by the government of Nauru they have three options: stay on Nauru, relocate to Cambodia or return home where war or persecution awaits them.
I believe those of us living in comfort have a duty to help vulnerable people. Australia has the resources to help them live happy, productive lives. Instead it banishes them to a remote island to live like prisoners.