The holdings in your capital have very little impact on the tech there, because the player is probably better at teching-up than any AI.Okay. That explains quite a bit.
That said - this then branches off to other areas in the strategy...
Say, Baghdad has 7 holding slots, with 4 occupied initially. I was under the impression that somehow holding castles was a better idea for muslim rulers, but this throws monkey wrench at that very idea. Do you build cities as a muslim ruler? At all?
In fact, because of the massive bonus to levy size in your capital province, it's usually recommended to hold as many castles as possible in your capital. (The "Great Walls" great work synergises very nicely with this - if you can, it's arguably the best GW for your capital province, as it can add 10-20k troops to your personal levy.) There's a smaller bonus for the provinces in your capital duchy, and you've probably used up most of your demesne limit by this point, so you would usually only hold the capital of those counties.
Usually, you should prioritise "spending" your demesne limit on castles (instead of cities/temples), because one of the two things you want from your demesne is good-quality highly-reliable troops, and castles are the best at that. By far.
(IMO, the other thing you should look for when choosing your demesne is a province-specific bonus - eg. a silk road trade post, or a holy site allowing easy conversion to another religion, or both. Kabul FTW!)
If you're looking up to fill up your non-capital provinces, cities are usually the best choice - you can push their taxes up to 80% via realm laws ("obligations"), and that can lead to a really nice continuous base income. However, it can be useful to have a couple of baronies somewhere in your demesne, as they are easy to revoke and grant to claimants. (Pressing kingdom claims as an emperor is the fastest way to expand. Pressing wrong-religion kingdom claims and then immediately revoking everything is even better, although it's also a dirty exploit.)