When people joined the Buddha's Sangha or monastic community, they lost their former worldly caste status, as follows:
Just as the mighty rivers on reaching the great ocean lose their
former names and designations and are just reckoned as the great
ocean; even so, when members of the four castes—nobles, brahmins,
commoners and menials—go forth from home into the homeless life in
this Dhamma and Discipline proclaimed by the Tathāgata, they lose
their former names and lineage and are reckoned only as ascetics
following the Son of the Sakyans. This is the fourth wonderful and
marvellous quality in this Dhamma and Discipline…
The Simile of the Ocean.
However, the Buddha did not oppose the caste system in non-Buddhist society despite often emphasizing to Brahmins they are not noble or Brahmin by 'birth' ('family lineage') but noble due to their actions (kamma), as follows:
For name and clan are assigned as mere convention in the world.
Arising by mutual agreement, they’re assigned to each individual.
For a long time this misconception has prejudiced those who don’t
understand. Ignorant, they declare that one is a brahmin by birth.
You’re not a brahmin by birth, nor by birth a non-brahmin. You’re a
brahmin by your deeds, and by deeds a non-brahmin.
You’re a farmer by your deeds, by deeds you’re a professional;
you’re a trader by your deeds, by deeds are you an employee;
you’re a bandit by your deeds, by deeds you’re a soldier. you’re a
sacrificer by your deeds, by deeds you’re a ruler.
In this way in accord with truth, the astute regard deeds. Seeing
dependent origination, they’re expert in deeds and their results.
Vāseṭṭha, there are these four castes: aristocrats, brahmins,
merchants, and workers. Some aristocrats kill living creatures, steal,
and commit sexual misconduct. They use speech that’s false, divisive,
harsh, and nonsensical. And they’re covetous, malicious, with wrong
view. These things are unskillful, blameworthy, not to be cultivated,
unworthy of the noble ones—and are reckoned as such. They are dark
deeds with dark results, criticized by sensible people. Such things
are seen in some aristocrats. And they are also seen among some
brahmins, merchants, and workers.
But some aristocrats refrain from killing living creatures, stealing,
and committing sexual misconduct. They refrain from speech that’s
false, divisive, harsh, and nonsensical. And they’re content,
kind-hearted, with right view. These things are skillful, blameless,
to be cultivated, worthy of the noble ones—and are reckoned as such.
They are bright deeds with bright results, praised by sensible people.
Such things are seen in some aristocrats. And they are also seen among
some brahmins, merchants, and workers.
MN 95 states about the Buddha:
He doesn’t wish any harm upon the community of brahmins. …
DN 27 describes a 'brahmin' as follows:
Then some of those same beings thought: ‘Oh, how wicked things have
appeared among beings, in that stealing is found, and blaming and
lying and the taking up of rods and banishment! Why don’t we set aside
bad, unskillful things?’ So that’s what they did. ‘They set aside bad,
unskillful things’ is the meaning of ‘brahmin’, the first term to be
specifically invented for them.