Looks like a bug with the "X spacing" value (if you set X spacing to 0, the tiles are not looking good, but the correct one is displayed).
When tiles X space > 0, their index seems replaced (my tilemap does not use spacing so I had not encountered this issue).
Definitely report a bug for it.