Headphones have a notoriously non-flat response, partly on purpose! They actually cannot be flat if seeking to provide something that emulates flat response, due to close-coupling with the ear.. complicated by the fact that everyone's ear shape and ear-canal resonance is different. No single headphone on its own could work for everyone.. and that is true to a degree far greater than any one pair of speaker monitors (where there exists plenty of subjectivity in which may be sufficiently accurate and right enough to do the job).
Headphones are great for hearing detail and doing initial editing stuff, and can work fine for the "cut and post" school of recording processing as rumbleseat refers to it. Great for aligning, hearing problematic stuff, making fades, placing track markers, etc. All the things that basically translate automatically to any other listener using any other playback system.
If you learn to "know them" well enough, headphones can work okay for general EQ correction (addressing obvious problems) and dynamics, but be careful going too far with those. Those things do not automatically translate to other listeners and systems. EQ correction is the most powerful and generally useful tool tapers have available to them, capable of turning something meh or even yuck, into a wow. Yet for the reasons mentioned, headphones make it difficult to really dial that in objectively. Its really temping to keep going with what you are doing until it sounds awesome. But at that point one actually ends up compensating for the headphones, and headphone listening itself, as much as correcting the recording itself. This is one reason why checking in the car, various speakers, and other playback systems becomes so important.
If you can avoid that trap by sticking only with the "cut and post" basic fixes and tasks, headphones can work great. Same goes for most speaker monitors, actually. I like the better open-backed Sennheiser headphones: HD600, HD650 (the masdrop HD6xx is similar), HD700. The Sony, Beyerdynamic mentioned already, and other headphones are good candidates too. But more so than choosing speakers, when choosing headphones you really, really need to listen to them carefully yourself to determine which sounds natural and might work well enough for you in this role.
There are ways of correcting headphone frequency response, even ways of emulating speaker listening to the extent that one can make proper soundtage decisions, but for them to really work well enough for this kind of work involves measuring and correcting not only the headphone response itself, but also measuring your own Head Related Transfer Function or HTRF (crucially unique to each listener) and applying that in addition to correcting the raw headphone response, usually via a special plugin in the DAW output.
Really good monitoring with speakers makes EQ, dynamics and soundstage decisions more universally applicable and easier. Best speaker monitoring these days similarly includes DSP correction based on measurements made with a mic at the listening position. There is some convergence going on with both headphone and monitor speaker correction toward a "monitoring you can truly trust" level in that way. Speakers in your room corrected in such a way will work for anyone sitting in the sweet spot, where as headphone correction is unique to each listener.
That kind of DSP correction is what we really need to get accurate enough monitoring sufficient to make "mastering like" level decisions. It is analogous to putting most of your investment toward really good microphones on the recording equipment side. All the other gear mostly just needs to work in support of the microphone output.
The only thing more important than the microphones themselves are where you place them and how you arrange them. Same goes for headphones and speakers used to make decisions on the opposite end of the recording chain. The acoustic transducers at either end of the signal chain and how you implement them have more influence than any other piece of equipment.