If you were these two fledgling nations, struggling for relevance in the modern world, and your only condition for entry into a well respected international organization is decriminalization of homosexuality, would you turn away just because of homophobia, or would you be pragmatic and made that comparatively small compromise?
I think a great many Somaliland leaders would consider it pragmatic to not feed into al-Shabaab's talking points about their supposed infidelity to Islamic law. Local politics and tradition trumps strategic global concerns all the time.