I wouldn't jump to any conclusions about ketosis having anything to do with your sleep habits.
First consider the most common perpetrators such as computer screens(my current perpetrator, 1.5 hours past my bed time), phones, lights in the rooms, noise, hot temperatures.
Do you take in caffeine other ways? Too much sugar? Chocolate, soda?
Are you extremely stressed because of work, life, etc? To the point where you can't think about anything else, can't relax at all?
Are you being physically active enough? Even so much as going on a walk for a half hour at a pace that has you breathing fairly good.
Once these are other factors are considered, then start considering new factors. Most often, I've found, with sleep, it isn't what you've changed that is causing you to stay up, it's what you haven't changed.
As for whether or not you should remain in ketosis: ask yourself what your goals are. Weightloss? Then yes, and stay away from any and all carbs you can (even fruit and sweet potatoes). Are you happy with where your body composition is? Then it's up to you. Want to gain at any cost? Stay out of ketosis.
And also, remember, ketosis means your body is using ketones to produce glucose, because you've not taken in enough glucose to provide your brain with its requisite 100g. That, however, does not mean your body only produces ketones when in "ketosis", but rather that your primary source of energy is fat, turning into glucose via ketones.