Oh, I thought your andcc #0x6f is clearing X as well, in fact it clears just S and I. I'm never using any nontrivial constants without comments about how this constant is constructed.
There are very few instructions, which may clear X-bit.
PULC
PULCW
RTI
TFR ??,CCR
So you may find all instances in your code and debug each instance. You shouldn't have a lot of these. Library code should include any of these instructions. So perhaps try disassembling you files and searching for all instances, then debug them all.
To narrow search, if you know your code very well, you should check the following. It could be return from interrupt (RTI), while SP pointing to wrong location. It could be a write to stack frame while serving interrupt (uninitialized pointer or smth. like that). Save CCR, clear I-bit, ... restore CCR sequence, which accidentally destroys saved CCR.