At any point in history was "Why cannot...?" used as frequently as "Why can't...?" Is it even grammatically correct to say "Why cannot you do this?" I know it can be rearranged to be "Why can you not do this?," but I always presumed the contraction and the contracted phrase could be used equivalently, without changing the sentence structure. I think this pattern holds true with the other question words (e.g. how, when, etc.); however, I also know it is common to say "Who cannot do this?" In general, are there rules pertaining to the uses of contractions in questions?
The transition point was about a century ago
Note that if we substitute a pronoun (I, he, they) for "why", the transition point comes much later (1980 for "I") – or hasn't even happened yet (all other pronouns). I can't explain why that is, except by pointing out that this very sentence is an increasingly typical usage. Maybe we all tend to be a bit less formal when introducing our own selves into the text.
It's only my opinion, but I think can't (similarly, let's) are examples of grammaticalisation. The contracted form has effectively taken on a "life of its own", leading to a situation where OP is prepared to accept that there may be contexts where can't is "grammatical", but "cannot" (or the equivalent "can not") wouldn't be valid.
Using cannot / can not might be a bit stilted in many contexts now we're so used to seeing the contracted form, but I don't think it's ever ungrammatical.
Arnold M. Zwicky and Geoffrey K. Pullum have shown that -n't is not just a contraction of not. The two American linguists pointed out that you can say why don't you... but not *why do not you... because you can place one and only one auxiliary before the subject in an interrogative phrase. Don't is a single word while do not are two words. -n't is not a clitic but a negative inflectional suffix.
Cannot is the only negative form that contains not rather than -n't. Theoretically, since it is a single word, you can say why cannot you... without a problem. My theory is that modern English speakers don't want to put cannot before the subject because it contains not and sounds like can not. You definitely cannot say why can not you... with a separate not. On the contrary can't remains a single word, which is why they use it more and more often.
If you go to Open Library, a search will turn up 52,223 interrogatives (questions) that begin with "Why cannot" in published English literature and there are over 2 million examples of interrogatives that begin with "Why cannot" on the internet.
Looking at a specific example, "Why cannot we" turns up with 758,000 interrogatives (and 8,064 examples in published literature). There are also many examples of "Why we cannot", but they are not interrogatives.
JForrest explains that 'cannot' is the negative form of 'can', and so 'cannot' should be placed in the same location as 'can' would be in a sentence. Since we can say "Why can we grow taller?", "Why cannot we grow taller?" is a logical and properly written negative. We don't say "Why we can grow taller?" so the construct should not be "Why we cannot grow taller?" The reason is that auxiliaries should come before the subject to make an interrogative.
I argue that the "Why cannot" usage is acceptable because of that rule mentioned by Shinji, above, that "you can place one and only one auxiliary before the subject in an interrogative phrase". Thus, "Why cannot" is acceptable though "Why can not" is not.
I admit that some people argue that the contraction "can't" should be used instead in this case. That option is quite popular - there are 16.6 million examples of can't on google and 90,470 in published literature. It is much easier to type can't, and easier to speak it as well. Contractions generally aren't considered ideal for formal writing, however.
Another alternative that is growing in popularity is the construction "Why can we not" which sees 1.2 million uses online, 9,900 in publication.