As you say, the way string theory requires all these extra dimensions and this comes from certain consistency requirements about how string should behave and so on.