In order to make walls, we need two properties. The first thing we will need is to block the character movements, so that players can't walk through the walls. You do it like this:
[X] tileset = ground.png block = true tile_x = 1 tile_y = 1
The second thing we need is autotiling – so that the wall image changes depending on what other walls are around it. To do that, we need to define a wall category, with the "wall" property (we can remove the "tile_x" and "tile_y" now):
[X] tileset = ground.png wall = X block = true
Now all the walls in the category "X" will be joined together, using the right graphics from the tileset.