A large port in the middle of nowhere is good because........?
Well, under normal circumstances it would'nt be, but at the time the area from northern Mozambique running up the coast to the Horn of Africa and the South Arabian coast were all parts of a major trade zone, and having a port in the South would be useful, now when we look we can see that their were only two real options for them; set-up shop on a small island that could be easily conquered, starved or otherwise disrupted, or build/lease/conquer a village on the mainland or Madagascar, where their were both large indigenous populations and near-by state-level societies.
Now, with an empty Madagascar you can build a trading place that has the advantages of being on the mainland without the disadvantages of having to worry about some neighboring native army coming around and causing issues.