The apex court said that caste cannot be a ground to discriminate against prisoners of marginalised classes in jails.