>if we had a 100% sure way of detecting that someone's going to commit a crime, should we use it
If it was 100% correct, it seems morally justifiable to use it, as long as you are a dictatorship. For a democracy, you would need not only correctness, but independently verifiable correctness. If the algorithm is 100% correct today but can be influenced tomorrow, you are giving absolute power over the state to whoever can influence the algorithm. After all, it's impossible to proof your innocence if you are convicted before the crime.
Basically, after solving the technical problems with creating the algorithm, you also need a system of checks and balances that can replace the public verifiability of our current court system.