c.1400, from can (v.) + not. O.E. expressed the notion by ne cunnan.
This doesn't really help, but it is a good starting point. The OED supplies the 1400 cite as follows:
Cursor M. (add. to Cott.) p. 959. 105 And þou þat he deed fore cannot sorus be.
It also defines cannot as:
the ordinary modern way of writing can not
Both Merriam-Webster and Wiktionary agree, by defining cannot as can not.
The Daily Writing Tips expand on this, their bottom line being:
There’s no difference in meaning between cannot and can not.
Funnily enough, they come to that conclusion after quoting two resources that say something slightly different:
The Washington State University language site:
These two spellings [cannot/can not] are largely interchangeable, but by far the most common is “cannot” and you should probably use it except when you want to be emphatic: “No, you can not wash the dog in the Maytag.”
Both cannot and can not are acceptable spellings, but the first is much more usual. You would use can not when the ‘not’ forms part of another construction such as ‘not only.’
That last point is especially interesting. A very similar concern is being raised on the Wiktionary Talk page for cannot:
Maybe our current definition is wrong or incomplete. To me, "cannot" and "can not" are different words. "I can not sit down" means you have the option of not sitting down, but "I cannot sit down" means you don't have the option of sitting down. "can not" is rarely used baldly like that, it's usually used with "only" - "I can not only get to the school, I can get there in 10 minutes!".
To the extent that "can not" is an acceptable way, at all, of writing "cannot" (also written "can't") - I bet it is only because it is such a common mistake.
That post goes on to link to this blog:
My public school teachers said can not was the correct form, and that cannot was a corruption. A friend of mine from a previous generation was taught the opposite.
Here's the explanation: If I can not do something, then I can also do it. I can not write these words if I choose (and you may think I shouldn't), but I also can, and am, writing them. What I cannot do is know who will read them, or what they will think. I can imagine such things, but I'm limited by my experience and perceptions. So this is the rule: if you either could or could not do something, then you use two words, because you can leave out the second word if you so choose. If you could not do something no matter how much you desired or tried, then you use one word, cannot. There is no other option.
Sometimes both are true. Witness:
- I cannot change the world.
- I can not change the world.
Languagehat chimes in:
[The Merriam-Webster definition of cannot as can not] is appalling for two quite distinct reasons: from a copy-editing point of view because it implies that cannot and can not are interchangeable, and from a lexicographical point of view because it's a lousy definition. The definition of cannot should be either "the negative form of can" (as the AHD has it) or a periphrasis like "is not able to." The only context in which can not, two words, occurs is as an emphatic alternative: "You can do it, or you can not do it." In that case, it is clearly two separately spoken words, with the not given special emphasis, and equally clearly it means something very different from cannot, namely "have the option of not (doing something)." The only acceptable form for the unabbreviated negative of can (or, if you prefer, for the expansion of can't) is cannot, one word.
Take from all that what you will. Some of it is probably justification in hindsight, and certainly none of it actually explains how that 1400 cite came about and why this particular spelling prevailed over can not, canot, cant, and can non. As you say yourself, languages are not always logical.