I don't see why consciousness cannot be the product of darwinian evolution. Even if we accept that consciousness offers nothing to the survival of a species, it would have to be a hindrance somehow for it to be ruled out by evolution. I don't think there's any evidence that consciousness lessens the chances of survival, quite the contrary.
As for "why" it came to be when it seems that everything about consciousness has a physical counterpart, my opinion is that we are quick to separate it from its physical counterparts. When a brain of a certain complexity evolves, then consciousness emerges. This has no direct link with evolution, it is just what happens. As a molecule of a certain complexity becomes "alive" and replicates, the same higher state is achieved by the complexity of a brain.