If it’s not clear what’s going on, and it likely isn’t, this dog is unfortunate to be of a breed that likes to dig up the soil after it pees. Not normally an issue, but this is the Albayzín in Granada, Spain. Almost every usable inch of soil is covered in buildings or stone, especially on side streets such as this one. Perhaps if you are lucky enough to have your own small plot of land, sure, but this little fella belongs to an urban dweller.
So he pees, scratches futilely at the cement-anchored stone, and follows his pack down the hill, proud of having accomplished precisely nothing. Perhaps there is a happy lesson in all of that, someplace.