You're conflating algorithms with data to some degree. The algorithm is responsible for finding the correlation, but whether that correlation is "irrelevant" depends entirely on the relationship between the training data and the full (presumably unknown) distribution over that set, as well as on fuzzy social interpretions (e.g., we may simply decide by fiat that race is an irrelevant feature for deciding mortgage approvals because we want to enforce that as true within the system).