We were running in the center of Madrid and we decided to pass (by) the Gate of Alcalá (in order) to go (running through) the Retiro Park, instead of (running on) the road.
In this aisle, por is used to talk about the route: Estábamos corriendo por el centro de Madrid y decidimos pasar por la Puerta de Alcalá para ir por el Parque del Retiro, en vez de por la carretera.