That is quite sad. In this case you are not firing for the wrong reason.
I get that HR might need to verify that this person is being fired for the right reason and that no discrimination is in play (which might happen unwittingly), but just keeping someone employed because they are a minority is not a good solution.
On a related note. If I was a minority, I would think that I was just being hired or kept on the team because I am a minority and not for my technical ability. This behaviour from HR would further encourage that thinking.