When that line was written 1843, a certain type of war had been fought: the opium war, a war that covered 9 years. (Another one was to follow, though)Back then it was considered a worthwhile venture to trade opium and to control that trade. ....And to go to war over it in order to use at a disruptive force in other countries.
How different the current western governments look at this type of trade.......however, they still go to war over it.....war on drugs.
So, when saying: religion is opium for the masses, it really fits. Religion has it to fire up huge amounts of people, to simultaneously unite and divide, to call good what is evil, and to call evil what is good. Religion has many faces and it sure is considered something worthwhile to controle and to go to war over it.....and use it as a disruptive force in other coutries.
Cheers
Borgia