In string theory, all of the standard model charges (electric, color, and weak hypercharge) arise from Kaluza Klein theory and through the interactions between strings and branes. But little is said about the magnetic charge, which is a property of M5 branes. All that is said is that it is the dual under the electric-magnetic duality. But does it arise due to KK theory and interactions, or is it just a fundamental innate property that does not arise due to anything else? Does this question make sense?
First, let me remark in passing that in orthodox string phenomenology, none of the standard model charges arise as they do in old-fashioned Kaluza-Klein theory, i.e. from gravity in compactified dimensions. They either come from branes, or from the gauge charges of the heterotic string.
You ask where magnetic charges (i.e. monopoles) come from in string theory, and mention the magnetic charge of the M5-brane. I am far from sure that every monopole in string theory can be viewed as an M5-brane. I think that the way to approach this question is to consider how monopoles arise in grand unified theories, then the phenomenon of electric-magnetic duality, and finally, how electric-magnetic duality arises in string theory.
In grand unified theory, a kind of monopole discovered by 't Hooft and Polyakov can arise as a soliton. But the study of dualities revealed that such solitonic monopoles sometimes have an equal claim on being regarded as the fundamental objects, since the dual set of elementary particles can in turn be constructed from the monopoles. The study of "electric-magnetic duality" often yields the necessary existence of a whole ensemble of "dyons" (charged electrically and magnetically) related by duality transformations.
So far I have just been talking about field theory. But these field theories with electric-magnetic duality appear to originate in string theory, where electric-magnetic duality corresponds to a change in perspective regarding the compact dimensions.
It's a vague answer, but I nonetheless believe it's correct to say that the existence of magnetic charge in string theory is bound up with the duality symmetries of string theory, and the existence of dyonic ensembles. I find it hard to be more specific because there are so many different duality relations, and none is more obviously fundamental than the others. It could be that my inability to be more specific is because string theory hasn't yet penetrated beyond the dualities to something more fundamental; or I may just have missed the memo explaining why one particular fact is the root of all the stringy dualities involving monopoles.