The sentence <em>"caminamos por la playa"</em> can be translated to "we walk along/through/by the beach", it depends on the context.
The preposition <em>por </em>has many different uses, one of them is to describe travel or motion. <em>Por </em>is used to refer to travel or motion through a place or location. So in this case, the sentence is referring to a motion (walk) through a place (the beach).