Two factors: risk of getting caught is relatively low if one is careful, and penalties are fairly minor if apprehended.
In my case, I never board a domestic flight without at least four bluntsworth of bud. And recently have been taking the same approach for international flights originating in the US with stops and terminus in countries with a strong tradition of rule of law and/or cannabis tolerance (ie, most of Western Europe, North and Latin America).
Your point stands however-- draconian anti-cannabis laws do exist, and enthusiasts will nonetheless take risks to indulge.