I do not know why. The tutorial I followed was https://www.youtube.com/watch?v=D_ybn4tYxs4.
I am not able to get the result of a nicely shaped flame.
Below is my set up for the domain:
You have brightness set to 1 on both of your bright contrast nodes, it should be 0 as you don't want to modify the brightness at all, increasing the brightness like this is effectively setting the background density to a value above zero, so the whole cube is being rendered.
In fact you don't even need those nodes at all
The other thing I noticed is the top attribute node should use the density attribute for the smoke, rather than the flame attribute.
In order for volumetric materials to render correctly you will also need to go to the light paths section of the render settings and set the number of volume bounces to something reasonable.