The Varnashrama dharma (caste system) is the backbone of Brahminism (Hinduism), untouchability is a part of that social order. We all know that Gautama Buddha was against Varnashrama dharma, and rejected the Vedic religion. But unfortunately, we see caste system and untouchability in many 'Buddhist' countries. For example, the Burakumin/Eta in Japan, Baekjeong in Korea, Ragyabpa in Tibet, etc. As we know as Buddhists that the Buddha was no hindu, then why this system is also in the societies of Buddhist countries?
Actually, Gautama Buddha was not against the caste system in mainstream non-Buddhist Indian society however he did emphasize social status ('caste'/'jati') was dependent upon here-&-now kamma rather than on physical & social birth (refer to MN 93, MN 98 and other suttas in the Brāhmaṇa Vagga). For example, he often emphasized a Brahman priest or caste member that does not adhere to the five moral precepts is not a Brahmana or Holy Man.
The Pali suttas have the following examples:
It was declared the Buddha "does not seek any harm for the line of brahmins" (MN 95).
The Buddha criticised Brahmans who marry & have sex with non-Brahmans. (AN 5.191)
The Buddha said wives who are immoral are expelled or caste out from families (MN 37.30).
The Pali suttas show no opposition to the non-Buddhist Indian caste distinctions however the Pali suttas do explicitly say when a person joined the Buddhist Community (Sangha) they automatically lost their former caste status or name (AN 8.19).
(4) “Just as, when the great rivers … reach the great ocean, they give up their former names and designations and are simply called the great ocean, so too, when members of the four social classes—khattiyas, brahmins, vessas and suddas—go forth from the household life into homelessness in the Dhamma and discipline proclaimed by the Tathāgata, they give up their former names and clans and are simply called ascetics following the Sakyan son. This is the fourth astounding and amazing quality that the bhikkhus see in this Dhamma and discipline….
As for contemporary Asian societies, many of these societies were previously or concurrently Hindu in relation to the arrival of Buddhism. Similar to when the Buddha was alive, Buddhist monks generally do not act to oppose & destroy other religions. Buddhism is not like Judaism or Christianity. Thailand is an excellent example, where most religious people still follow other religions, such as spirit, ancestor or Brahma worship (even though they consider themselves "Buddhist").
The most important idea in Buddhism with regards to caste is that regardless of which background one is from, if one is righteous, consummate in virtue, and earnestly seeks the path to the end of suffering, he would definitely find it.
As to why certain Buddhist majority countries have some kind of caste system - well, that does not come from Buddhism. It comes from the natural tendency of human societies to form socioeconomic clusters, which applies to all countries in the world, including the fully developed countries. Please see this article on inequality in the USA.
However, what is special in Hinduism is that the caste system is found in the religious scriptures and is part of the religion. A religion-enforced caste system is not found in Buddhism. Buddhism also does not comment on the political ideology of lay societies e.g. democracy, capitalism, monarchy, socialism, communism etc.
From the Gihi Sutta (AN 5.179):
In the same way,
wherever one is born
among human beings —
noble warriors, brahmans,
outcastes, or scavengers —
if one is tame,
with good practices,
consummate in virtue,
a speaker of truth,
with conscience at heart,
one who's abandoned birth & death,
completed the holy life
put down the burden,
done the task
gone beyond all dhammas,
through lack of clinging
offerings to this spotless field
bear an abundance of fruit.
From the Sundarika Sutta (SN 7.9):
Then Sundarika the brahmin went up to the Buddha, and said to him: “Sir, in what caste were you born?”
“Don’t ask about birth, ask about conduct.
For any wood can surely generate fire.
A steadfast sage, even though from a low class family,
is a thoroughbred checked by conscience.
In your question, you have performed what is called the logical fallacy of 'False Equivalency'.
The caste system in Hinduism as practised in India and Nepal is a decree of the Hindu scriptures. It is mentioned in Hindoo scriptures like Gita and Manusmiriti. So the professions in India have originated from the Caste of a person. Moreover, the Hindoo caste system tells you that if you are a Dalit then you have to do good karma to first become a Brahmin and then you can attain the moksha (as per Manu Smriti).
In the examples you have given, it is more like a class system taken to an extream. That was originated as a discrimination in the society and not handed down by Buddhism. Buddhism as such has nothing to do with that inequality. All the people if Buddhist in these countries are on an equal footing of Dhamma and not discriminated by the Dhamma.
As we know as Buddhists that the Buddha was no hindoo, then why this system is also in the societies of Buddhist countries?
Again, if a hindoo follows their Dharma strictly then they have to adhere to the caste system.
And if a Buddhist will adhere to the Dhamma strictly then He/She will NOT adhere to any discrimination.
So, why is this still practised in some Buddhist countries?
Its because people are not well instructed in Dhamma. People there are Buddhist just for namesake because their parents are Buddhist or the society is Buddhist. The Dhamma is not practised by them, that way.