“so Joshua burned Ai.” Joshua burned only three cities in the conquest of Canaan; Ai, Jericho, and Hazor (Josh. 6:24; 8:28; 11:11).
“a mound of ruins.” The Hebrew is a “tel,” which is a mound of ruins, not just a “heap.” When cities were destroyed, the ruins were a pile that was higher than the surrounding landscape. Over time, the ruins sometimes piled up and became quite high. Any city of the Israelites that turned to idolatry was to be made a “mound of ruins” too (cp. Deut. 13:16), but that never happened even though cities in Israel did turn to idolatry, e.g. Dan.