The for/next loop goes too fast. It should be more like this:
load image "sprites/wall1.png",1
hide mouse
set text opaque
boxes=1:tim=timer()
do
sprite boxes,mousex(),mousey(),1
text 0,0,str$(boxes)
` Make Cubes and place when player clicks
if mouseclick()=1 and timer()>tim+300
inc boxes
tim=timer()
endif
loop
The code snip above starts "boxes" at 1 and increases once everytime the mouse button is clicked. Having the sprite command before the if/then to check for the mouseclick gives you the same ability without having to put in another sprite command. I also put a timer in to slow it down... without it the number of sprites go through the roof.