There are some parallels in the dilemma we have around Musk (and others) and those we have with terror networks. Though the nature of the threat each represents to society is different, some of the ethical and moral dilemmas about how we respond to them are similar.
In the case of immensely rich and powerful people like Musk, the practical complexity of enforcing legal frameworks to constrain them are such that the easier thing to do would be to arbitrarily detain them but to do so would go against the principles of natural justice that underpin our society.