If you're going to put a magazine in your pocket, it needs to be the ONLY thing in the pocket.
No coins, keys, knives. You don't want to grab for your mag and get something else instead. Or get something else in addition to the magazine and have to fumble around to drop what you don't want while keeping what you do want. You don't want anything damaging the magazine or the ammunition.
No lint or other pocket dirt. Clean the lint out of your pocket before you put a magazine in there. You don't want a chunk of pocket lint getting into the magazine and potentially causing function issues.
I suppose that putting the magazine in its own container inside the pocket solves some of those problems but also incurs a significant penalty in terms of ease access.
It's not that likely that you'll need a spare magazine, but if you do, you will want it to work and you will want to be able to access it easily and rapidly.
The key here is to think about WHY you are carrying the magazine. If it's just to have a nice warm fuzzy, then it really doesn't matter. If it's to provide a means of dealing with a magazine related stoppage, or to provide the opportunity to reload in the middle of a self-defense encounter, then rapidity of access is critical and putting it in a pocket in a separate container probably doesn't make sense. If it's to provide the opportunity to reload with a full mag after a self-defense shooting, then ease of access isn't a big deal but you do still want the mag to be functional so maybe a separate container makes sense.