Because heat rises and the flame under the balloon thingy releases heat, and the heat gets trapped, and the heat rises.
Hot air balloons rely on buoyancy to float up into the air. Something is buoyant if it is less dense than the surrounding gas or liquid. When air is heated, it expands, becoming less dense than the air that is not heated. If the hot air is contained as it is in a balloon, it can force additional weight up into the air.