There are several reasons why some arabs think somalis are also arabs:
1) all somali clans claim arab lineage from the prophets family, none of this is proven but it seems some arabic sources accept Darood claims. Some other arabic sources like the book of zanj describe somalis as being arabs. Some Yemeni tribes also accept Darood as having arab origins or at least they accept a cultural link, even though we should take this too seriously.This is very similar to some pakistani and indian muslim tribes who claim arab descent, they know it's false or at least shady but they have told this lie for so long that everyone pretends to believe it.
2) the somali elites before Independence used arabic as a second language and often traveled a lot to the arab world. Every written corrispondence before Independence in Somalia was written either in arabic or in af somali with arabic characters. Most of the sultanates in modern day somalia like Ajuran, Adal, ifat etc used Arabic and had trade relations with arabs
3) Somalis are heavily arabized because of islam and geographic proximity to the arab world. Somalis became more arabized in the last 200 years or so, but we have been in close contact with arabs for more than 10 centuries
4) Somalia joined the arab league. Actually when we joined we were accepted mainly for the reasons I stated above, the Arab League members probably didn't consider us as legit arabs but it was close enough for them. They probably wouldn't have admit other muslim subsaharan countries except Somalia and Djibouti. Countries like Senegal or Mali wouldn't have been accepted because their historical cultural ties with the arab world are much weaker.
In conclusion, we are NOT arabs not linguistically, not culturally and not ethnically however we are the most arabized non-arab subsaharan African nation