You got your first x y backwards. I haven't tested this code because I didnt have a tile handy.
set display mode 800,600,32
tilesizex = 32
tilesizey = 32
rem load images
load image "wall.png",1
rem dim map
dim map(20,17)
rem create map
for y=1 to 17
for x=1 to 20
read map(x,y)
if map(x,y)=1 then paste image 1,x*tilesizex,y*tilesizey,1
next x
next y
wait key
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1
data 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
