Except northerners were heavy supporters of his regime, with plenty of high ranking members of the government and military being from the north. He clearly had a huge support base across the country because Somalis generally liked him.
Then some disgruntled Marxists mad that he cut ties with the USSR proceeded to run to Ethiopia and attack the country by funding insurgencies. However Barre was constantly defeating them until 1991.
He had a minority base and he went to war with large parts of the population. And the rest is history. Despite super power backing the maths didn't add up for him.