1 Peter 2:13-16
13 Submit yourselves to every ordinance of man for the Lord's sake: whether it be to the king, as supreme;
14 Or unto governors, as unto them that are sent by him for the punishment of evildoers, and for the praise of them that do well.
15 For so is the will of God, that with well doing ye may put to silence the ignorance of foolish men:
16 As free, and not using your liberty for a cloke of maliciousness, but as the servants of God.
KJV
You'll notice that these verses are talking about following the laws of the land. This is the best passage I have found in the Bible regarding this. It says to obey the governors when they punish evildoers and praise the righteous. And when you are free to do something, not to use the freedom for unrighteous acts. Now you ask, "what if the law goes against these guidelines?"
Job 34:19-20
19 How much less to him that accepteth not the persons of princes, nor regardeth the rich more than the poor? for they all are the work of his hands.
20 In a moment shall they die, and the people shall be troubled at midnight, and pass away: and the mighty shall be taken away without hand.
KJV
There is no earthly government above God. They can make all the laws they want and it will make no difference because God is greater, and long after the governments and nations fade into oblivion, God will still be the same. When they asked Jesus what commandments they were to follow to have eternal life, he said:
Mark 12:30-31
30 And thou shalt love the Lord thy God with all thy heart, and with all thy soul, and with all thy mind, and with all thy strength: this is the first commandment.
31 And the second is like, namely this, Thou shalt love thy neighbour as thyself. There is none other commandment greater than these.
KJV
As long as marijuana does not cause you to break those commandments, then I say it's just fine.