Illegality is indeed one of the possible mediators of the association. A recent study has demonstrated decreased suicidality in states where cannabis was legalized
Ye I wasn't being facetious, more drawing from personal experience. Amazing to hear that it is actually correlated though. It does cause users stress from it being illegal and hard to get hold of. It means lying to friends, colleaugues and also maintaining unsavoury aquantances to be able to score etc. Many also genuinely smoke it to block out the bullsh!t of the world and reality which can make them feel helpless, angry or depressed.