It's illegal because the cops whose jobs practically depended on the prohibition were going to go out of business once alcohol was re-legalized unless there was some other banned substance they could go after. Some racist fuck-up decided to create propagandist movies about how bad cannabis is, and apparently that's very convincing for americans (fuck you and your shitty country, by the way) who thereby decided to ban it. USA's fuckbuddy countries (that includes your country as well -- fuck you too) banned it too in order to follow in their master's footsteps. Fuck this world.
Nowadays it remains illegal because the pharmaceutical industry would really hate having a natural alternative to most psychotropic drugs, an alternative with little to no side effects at all. Many popular brands would simply cease existing.