Bear in mind that the word 'consciousness' has several distinct meanings. 'Consciousness' can refer to the state of being awake, to the ability to introspect internal states, and to the phenomenon of attention. But 'consciousness' insofar as it poses a 'hard problem' for physicalists is the subjective quality of experience.
These subjective qualities can be features of sensations, but they need not be. Smashing my knee against a table leg elicits a certain unpleasant sensation. The felt quality of that sensation is an example of a conscious datum in the relevant sense. But so is the shimmering quality of a magnificent Saguaro cactus standing sentinel on a distant ridgeline as viewed in the lambent light of the desert Southwest. Qualia, then, can be associated with intentional objects and not merely with non-intentional states like sensations. Pressing some Husserlian jargon into service, we might distinguish between noematic qualia and hyletic qualia.
But the main question I want to pose is this: What good is consciousness from an evolutionary perspective? Owen Flanagan, Consciousness Reconsidered, MIT 1992, p. 42) has this to say:
What function might sensory or perceptual consciousness serve? Such consciousness could enable an organism to be sensitive to stimulus saliencies relevant to its suvival and to coordinate its goals with these saliencies. Informational sensitivity without experiential sensitivity (of the sort an unconscious robot might have) could conceivably serve the same function. Indeed, it often does. But the special vivacity of perceptual experience might enable quicker, more reliable, and more functional responses than a less robustly phenomenological system, and these might have resulted in small selection pressures in favor of becoming a subject of experience. At least this is one possible explanation for why Mother Nature would have selected a mind with capacities for robust phenomenological feel in the sensory modalities. It is good that reptiles are sensitive detectors of earthquakes. It enables them to get above ground before disaster hits. It is good that we feel pain. It keeps us from being burned, cut, and maimed. . . . Like photoreceptor cells designed for vision and wings for flight, the capacity to experience pleasure and pain is a design solution that Mother Nature has often used in different lineages of locomoting organisms.
I judge this to be a complete failure as an explanation of why consciousness has evolved. All the jobs Flanagan mentions might have been done 'in the dark' by unconscious processing. Yes, pain is good insofar as it keeps us from being burned, cut, and maimed. But pain in this sense is just the sum-total of physical events that play a certain causal role, that of causing the organism to withdraw or protect a part of its body on the occasion of a certain input. Think of a robotic arm equipped with heat sensors. It is designed to retract when the object it touches is at a certain temperature or above. The arm can function perfectly well without feeling anything.
Let's not forget that words like 'pain' lead a double life. 'Pain' is used to refer both to physical events and to their phenomenal manifestation. Phenomenal pain, far from being good, is evil, a form of natural evil. Insofar as it is (instrumentally) good, pain is not felt or phenomenal pain but the physical events that may or may not manifest themselves at the level of consciousness.
Consciousness is real -- eliminativism is for lunatics -- and so consciousness must be explained. But an evolutionary explanation is inadequate. Such an explanation must specify a survival function consciousness serves that could not be served without it. But what could that be? Thus I think David Chalmers (The Conscious Mind, Oxford 1996, p. 120) is on the right track:
The process of natural selection cannot distinguish between me and my zombie twin. Evolution selects properties according to their functional role, and my zombie twin performs all the functions that I perform just as well as I do; in particular he leaves around just as many copies of his genes. It follows that evolution alone cannot explain why conscious creatures rather than zombies evolved.
Chalmers also points out that
. . . the real problem with consciousness is to explain the principles in virtue of which consciousness arises from physical systems. Presumably these principles -- whether they are conceptual truths, metaphysical necessities, or natural laws -- are constant over space-time: If a physical replica of me had popped into existence a million years ago, it would have been just as conscious as I am. The connecting principles themselves are therefore independent of the evolutionary process. While evolution can be very useful in explaining why particular physical systems have evolved, it is irrelevant to the explanation of the bridging principles in virtue of which some of these systems are conscious. (p. 121)
This strikes me as an extremely important point. If we think of evolutionary genesis as proceeding 'horizontally,' then the arisal of consciousness can be thought of as 'vertical.' If we want to explain how consciousness arises from its physical substratum, it is simply irrelevant to be given an explanation of how certain traits were selected for. An evolutionary account might explain 'horizontally' how an organism became sufficiently complex to host consciousness, but such an account would do nothing to explain how consciousness arose 'vertically' from the organism.