The reason is that there isn't much fish to go around in South America, so the Pope made a special dispensation to consider capybaras as fish. There was probably a better way to do it, but that's what he did, and so, yeah, capybaras are considered fish according to Roman Catholic canon law.