There's actually a rumour/conspiracy theory saying he joined to minimize damage to the nation as a whole (aka attack hard/fast with a regular army and conclude the war swiftly with the South's honor intact, hopefully). There were no allusions that the South lost before the first bullet was fired and he had intimate knowledge of what the US Army was capable of (having graduated from West Point and serving with most of it's officer corps).
In many ways, if I had to take a wild guess into the mind of Bobby Lee when he was contemplating doing the unthinkable in his Virginia mansion on that night in 1862; I think he was trying to pull a Jesus and sacrifice himself so that the bodycount stayed under a million. Or maybe I'm giving the man too much credit.