Well, it was not always illegal - I remember times when cannabis grew in school garden as an example of useful industrial plant :-)
All this "war on drugs" is plainly stupid but it would take ages before the laws are changed because if drugs are legalized a lot of shady profits would be gone...