Nexus 7: Compass drifts over time
It turns out the compass needed to be calibrated.  I rotated the tablet a full 360 degrees in all three axes, and the problem cleared up.

I used this app to monitor the orientation sensor, and while I still see the X axis orientation value drifting, it is being corrected automatically so that accuracy is maintained.