Now, you feed AI with crime data, looking at statistics such AI will suspect people having black color of the skin to be criminals more often than people with white skin. Is that ok? Is it ok to say that if some person happens to have black skin there is a bigger chance that it is criminal?
In statistical terms the answer is yes, but if we deal with an actual person, we should treat it as a unique person and the matter of the skin color should not matter.
Before II World War there were scientific studies in Germany that showed that in some big cities districts there are more rats. Accidentally or not, it turned out that those are districts with large Jewish population. So Nazis took those statistical results to prove that Jews are dirty, spread diseases, etc. Was that science, even though it was peer reviewed and published? Rather not (in the first place they didn't even bother to check if people living there were rich, poor, etc.).
History knows many "scientific researches" by the ones like Eugen Fisher, dr. Mengele, that were performed in a scientific way, but they were lacking something very important and non-trivial: ethics.
Now the problem is that ethics needs to have some source, it does not grow on a tree. For ages Christianity was a source of ethics in Europe (less in US, that's why you could have slavery in modern times there), currently Christianity is almost gone in Europe, the question is were to seek the source of ethics.