If Secession was illegal, why was West Virginia allowed to do so from Virginia?
Shhhhhh. You're not supposed to talk about that.
The process for splitting a state into two separate states in included in Article IV, Section 3. Both the Congress and the body recognized by the government as the legitimate Virginia legislature voted to partition, as the Constitution allows.
But let me turn the question around. If secession is legal then why the beef about West Virginia?
Hey, weird things happen during wars.