It was his tradition as archbishop, but not the usual papal tradition.
This is a youth prison and Francis often went to those places in Buenos Aires. He probably didn’t know that in this prison in Rome, there were only 6 Italians, and the rest of the prisoners were mostly North Africans and mostly Muslim (both male and female).
However, his visit was explained to the prisoners, and they wanted to be there. So who knows...many good things may come of this.
I’d add that in the larger view, this tradition goes back 2,000 years.
Perhaps the muslim prisoners went into it thinking their superiority and felt haughty enough to “make” a Christian wash their feet.
And perhaps they came away humbled.