Did you do resistance training on a regular basis while on keto?
When at a deficit, your body gets rid of what it doesn't need.
The goal is to tell your body it needs the muscle (and doesn't need the fat).
Edit: just read that you don't lift. That's why you lost muscle.