In histogram equalization, like in every other form of intensity mapping, each input intensity is mapped to another intensity in the output image. If the input image has 500 pixels with a value of 255, then all those pixels will be mapped to the same output intensity, and the output image will have 500 pixels with the same value.
That is to say, there is no way for the histogram equalization to spread the pixels in that 255 bin across different output values, and thus the output histogram will also have one equally tall bin.
One trick you can do is to convert the image to a floating-point type (I presume it is 8-bit unsigned integer), add a small amount of noise (e.g. add a random value between 0 and 0.5 to each pixel), and then apply the histogram equalization. In this case, the 500 pixels with value 255 no longer have exactly the same value, and therefore can be spread nicely across various intensities in the output image.
Do note that, for this to work, the histogram equalization algorithm has to be designed to work with floating-point inputs, and either use a histogram with more than 256 bins, or use interpolation when doing the inverse mapping, so that those similar input values actually do get spread across various output values.