That’s right! Lee’s loyalty was to Virginia! Since his loyalty was to Virginia (and thus necessarily not to the Union when the wto were in conflict), he tactily approved Virginia’s secession. He may not have “believed” in secession, but he sure as hell did not oppose it. Or else he would have accepted Scott’s offer to become the commanding general of the Union forces in a war against the seceding states.
Had Virginia stayed in the Union I’m sure Lee would have been quite willing to lead the Union armies. From his words, it sounds like he would have preferred that to what actually did happen.