My guess would be this has more to do with logistical reasons than technical limitations.
It likely has something to do with airline schedules in European / North American airports where there can often be a night-time curfew in place at airports due to noise concerns etc.
e.g. I remember Frankfurt till recently at least didn't allow scheduled international landings before 05:00.
Ergo, you need to make sure you take off from Dar es Salaam etc. at times that will ensure a landing slot at EU that won't infringe on the curfew. Many flights even to non-EU, western destinations from Dar es Salaam likely connect via EU hubs.
More details at this link about curfew times at various EU airports:
A part of this can also be the greater (i.e. worse) elasticity of booking response to odd / inconvenient flight times in wealthier markets. i.e. One uses up the best slots for wealthier intra-EU markets for the most elastic customers & then whatever slots remain go to longer, international routes irrespective of the late night slot that results at the destination non-EU airport. i.e. An airline route scheduling team cares far more to ensure departure / landing times on a Copenhagen-Stuttgart flight remain convenient time slots than to try and keep a Dar es Salaam departure daytime.
Also, in the intra-EU markets there's competing modes of travel. e.g. Confronted with an inconvenient 23:00 flight a business traveler might choose a 17:00 train instead.
On a Dar es Salaam to Europe sector there's really not any non-air-flight competition for passengers. So one can afford to keep inconvenient local time departures and still expect no penalty from passengers voting with their feet. Of course, this can only be stretched so far because at some point a competing airline can launch a more conveniently scheduled departure. Or as a second order effect tourist traffic can switch plans to alternative destinations etc.
Incidentally, on a lot of Indian subcontinent sectors as well departures to EU were traditionally crowded in the 23:00 to 05:00 time slots.