When you touch the screen, all layers (even invisible ones) and all objects in this point of the screen receive this touch event.
So if you want to "exclude" some layer or objects, you need to add conditions like "Layer X is visible" or "Sprite is visible" to your touch events.
Another approach is to use event groups. For example, when player opens the in-game menu, you deactivate "CharacterControls" group and activate "MenuControls" group.
See these posts for some examples: