If you're talking a 2D tile map it's better to use PASTE IMAGE rather than making all of them sprites. But with sprites the natural sprite priority is by the image number the sprite uses. Like if you had 5 sprites with image numbers 1-5 the one at the bottom will always be the one using image number 1, then 2, then 3, and so on. Doing it the "natural" way takes a bit of planning or you can use the method that Phaelax mentioned to make it easier (SET SPRITE PRIORITY).
To show you how natural sprite priority is the following randomly creates 17 sprite numbers but uses image numbers 1 to 17 on the screen and another sprite for the mouse coordinates. Move the mouse around the screen to see which image numbers are in front of and behind whatever image number the mouse sprite is using. Click the mouse button to randomly pick another image number.
` Create 17 sprites
for ImageNum=1 to 17
` Pick a random sprite number between 1 and 999
until sprite exist(SpriteNum)=0
` Create a box
` Show sprite number on the box
center text 25,0,"Image"
` Show image number on the box
center text 25,30,"# "+str$(ImageNum)
` Grab the image
get image ImageNum,0,0,50,50,1
` Create the sprite
` Pick a random starting image number
` Show the mouse
` Check for mouseclick
if mouseclick() and timer()>tim+200
` Pick a random image number
` Reset timer