Why is tobacco habit forming?

Nicotine. Most of tobacco dependency happens because nicotine is a dependency-producing chemical, causing tolerance (the same amount does less) and withdrawal when stopped. It is also habit-forming because someone smoking 20 cigarettes a day is taking over 400 puffs per day - 400 "fixes" of nicotine. Anything done that regularly, that often, is reinforcing psychologically, as well as physically.
Action in brain. Nicotine causes activation of senstive areas of the brain which then releases Dopamine , thus causing a pleasureable effect and reinforcer of a action. This is basis of addiction maintenance of a hedonic ( feel good) state. Other data shows that genes may be passed on that confer increased susceptibilty to its action.