When you arrive at an international airport on an international flight, you have to clear immigration pretty much first thing. There is usually only one immigration area per terminal. So the question is, how does the airport get passengers from the gate where the plane arrives to the immigration area? For security reasons they need to have fairly secure corridors from the plane to the immigration area. These corridors need basic amenities (bathrooms, maybe water faucets) but won't have shops, lounges, or anything else... they need you to clear immigration right away.
Airports can handle this in one of several ways:
1) For airports without a lot of jetways, where the plane just arrives on a ramp somewhere and a bus takes you to the terminal, the bus can take you right to the immigration hall.
2) Most modern airports with jetways have a staircase at the jetway leading up (example: TLV, EWR Terminal C) or down (example: JFK 4). When an international flight arrives all passengers are directed up or down that staircase. This leads to a parallel set of hallways which mirrors the terminal and leads to the immigration hall. In some places (EWR, TLV) it is glass enclosed and if you look down you see passengers milling about waiting for departing flights. In others (JFK 4) it is below the waiting areas, probably at or near ground level, and may just appear to be a bunch of sealed corridors.
3) There are a few interesting configurations where the "sterile" area is on the same level as the passenger waiting lounge area, for example, EWR Terminal B where you have a circular, glass-enclosed hallway surrounding the waiting lounge which occasionally fills up with passengers getting dumped off an international flight.
4) At many older terminals, they only have one hallway for both departing and arriving passengers. Sometimes they'll divide this hallway down the middle and open or close doors to keep departing and arriving passengers separated. If the hallway is too narrow to do this, they won't let passengers stay in the hallway... they'll use the hallway alternately for arriving or departing passengers, and clear it out between them. This is why some airports don't let you go to the gate until the flight is actually boarding: because the hallway may be in use for arriving passengers.
To answer your question... where were you? You were following the same path as someone would have taken for a departing flight, only in a hermetically sealed-off corridor so that the plane could be emptied into the immigration hall without any contact between departing and arriving passengers.