Not defending the practice but the Mohammed thing has a possible origin that isn't directly racist. The common names among Muslims and their propensity to appear on various watch lists lead to a lot of false alarms on those with those names.
It may be a racist result but there is a pretty reasonable and understandable reason it happens, ignoring the legality and morality of that kind of tracking as well.
I hope you extend this understanding to other patterns people recognize and act upon. :)