Why is the blue star hotter?

When a star is blue it means it is putting out light mostly in the ultraviolet spectrum which is of a higher energy than infared light, or light in the visible spectrum. This means the star has more energy and heat.