I've seen no evidence that there's been a big quake in Bam in the last 500 years. It's possible Bam has NEVER been leveled by a quake before.
Most of the seismicity of the area has been to the NW. A fault was mapped there but a given fault can go 5,000-10,000 years without rupturing.
In a treeless environment mud brick construction makes a lot of sense...especially if nobody in your particular town can remember it being leveled by an earthquake.