So I was creating this model, but I ran into a really strange problem when I tried putting a texture on it.

I already successfully had an alignment texture on this model and it was displaying just fine. But when I drew out a simple design (mostly just flat colors right now so I can see how well everything is coming together) and then applied this texture to my model, suddenly everything was drawn wrong. I thought at first that it had somehow glitched out the normals and I was seeing into the backside of the mesh, but as I look at it closer, it seems that it is somehow reversing the draw order. Faces that should be blocked by the faces in front of them are drawn on top. But only some of them? Some are drawn normal, and, well, it's all kinds of weird garbage, so here's a picture showing what is happening, compared with how it looks with just the alignment texture.

I have not encountered this before. What is happening?