It seems to me that if I click on a GUITexture the click event is captured not only by the texture but also by the object behind it

Because I have a GUITexture that is located before a wall. When I click on the gui texture unity executes both the scripts (the one attached to the gui texture and the one attached to the wall). So its as if I clicked on both objects!

Both the wall and the guitexture have the function OnMouseDown has a discussion of this. It’s kind of old, but don’t see anything newer. To sum up: there’s no great answer, since some people want clicks to go through guiTextures.

But, a hacky solution there (about 1/2-way down) is to create a plane with a trigger, childed in front of the camera where the GUI is. It will then “catch” all OnMouseDowns (won’t do anything, just prevent the wall behind from getting them.)

You can put thiungs in layers and then use raycasting to ignore or only select that layer.
Unity - Scripting API: Physics.Raycast …This ignores layer 10.