I kept mixing and confusing these two usage of N. Sometimes I spell "anoying", sometimes I spell "annointed". This is probably a silly question, and the answer is probably as simple as "that's the way it is", but I'm just curious why annoying using double N and anointed using single N, although (in my opinion) those two has similar structure, or at least, prefix. If I know why the difference exists between the two, I probably can automatically remember it next time. Thanks.
Spelling of things in any language sometimes changes for no particular reason. For example, "country" used to be spelled "countrey" in the English language. Why this word transitioned to the -y ending while "journey" didn't, is anyone's guess.
(In fact, in the second half of the 17th century, there is a curious spike in the occurrences of "journy", but apparently "journey" won.)
The farther you go back in time, the more you approach a period where there were no academies where a "correct" pronunciation would be determined, and also no dictionaries, at least none that would be widespread enough. Books themselves only started spreading among the general public (formerly spelled "publick") after the printing presses became widespread enough. As of 1740, there were only 400 printers in England. At the start of the 18th century, only about 500 new titles came out per year. [Source: "Commonplace Books and Reading in Georgian England" by David Allan.] So uniformity in spelling is something that only gradually comes about over time as some variants get weeded out and others establish themselves.
So the answer is, in fact, it's just the way it is. English has a lot of spelling irregularities; this fact came to be condensed in a word that is basically a satire of English spelling: ghoti.
Regarding your two words, Google is your friend in finding the etymology of both anoint and annoy—and seeing that, really, the predecessors of both of these words had only one "n". So, yeah, it's just the way it is.