I wanted to know what is a reason that wine and beer is not allowed in Islam and weed, cigarette etc ... is allowed. I heard that wine and beer contains alcohol. Does cigarette also contain alcohol?
None of the four items you mention are permitted in Islam. The general ruling is that anything harming the intellect and/or health is forbidden. Wine and beer are forbidden by a clear text, marijuana is forbidden by analogy (and by falling under the definition of khamr which is forbidden by text), and cigarettes are forbidden because they are harmful to health. They are all haram.
Please note that I am not an Islamic scholar but simply giving you answer with the knowledge I have.
In Islam anything which can possibly hurt your health should be avoided. Just because "alcohol", "wine" and "being drunk" are explicitly stated in the Quran does not mean that all other things which can harm, intoxicate or hurt you (like "weed", "cigarettes" or even a "water pipe") are allowed upon.
In fact, a strong verse to keep in mind is the following:
Those who follow the Messenger, the unlettered prophet, whom they find written in what they have of the Torah and the Gospel, who enjoins upon them what is right and forbids them what is wrong and makes lawful for them the good things and prohibits for them the evil and relieves them of their burden and the shackles which were upon them. So they who have believed in him, honored him, supported him and followed the light which was sent down with him - it is those who will be the successful.
and forbids them what is wrong [...] and prohibits for them the evil
What people who call themselves "muslim" do is their choice and path in life. Just because they do "x" and do not do "y" does not mean that they are, though often mistaken to, represent Islam with their actions. Muslims are ambassadors of Islam and I agree that it can confuse you when they do certain things which conflict with Islam but please do not draw conclusions about Islam depending on what muslims do.
This does not only apply to Islam but for anything in which a minority can influence your entire view.