One thing a colony affords is a "colonial governor", and his staff. It can be a sinecure to send unwanted nephews. I'm not saying that's the main reason of course. But it could be a factor. Why did France try and retain Algeria for so long? Not much there, and it came back to bite France.
Places like Egypt I can understand, and Iraq, etc. But apparently places like the UAE were never colonies, officially, but that was before the black gooey stuff was found. Why does Qatar even exist?
The only country in Africa never colonized is Ethiopia. Italy tried. Maybe it's a kind of status symbol.