Stable twisted curves and their $r$-spin structures