Did He truly build a fence?
Rav Sadya Gaon, Ri Kara: It is as if He fenced.
R. Avigdor: This refers to girls of Lud. They would knead their doughs and ascend to Yerushalayim and pray, before they became Chametz.
Palgei Mayim: He made my Yetzer ha'Ra heavy, and fenced against the ways of Torah and Mitzvos.
Why does it say "Nesivasai Ivah"?
Rashi: If I came to leave, I cannot leave on straight paved roads due to the enemy, and I went on a crooked path.
Ibn Ezra: He made the known paths crooked.
Ri Kara (from Yerushalmi Ma'aser Sheni 5:2): He made my paths crooked, so I do not know to find the straight path to return to my place. There was a man who ran after his ox, until he found himself in Bavel. A Babylonian recognized that he was from Yerushalayim. He asked him on which path he came. He could not find it. They applied our verse to him.
Palgei Mayim: Because He withheld from me Torah and Mitzvos, I accustomed myself to crooked and ruined ways.