The photoshop gradient tool is actually not linear by default. Linear is boring and low contrast. Actually linear is also a bad word since in reality the displayed data on the screen actually has a gamma curve applied to it.
There's a setting in the gradient tool called "smoothness" which attempts to make a gradient appear to smoothly transition from one colour to another mathematical linearity be dammed. The histogram curves up and doesn't look perfectly flat because there is a small contrast increase to make the colours appear to transition more evenly. If you set the smoothness to 0% and re-do a gradient you'll end up with a lot more grey, less white and black, and also a perfectly flat histogram. (boring result though which is why histograms should not guide your photography but merely help analyse the result).