Clearly corals have some ability to act upon sensory input. They open when the lights come on, close when something touches them (self preservation), they spawn based on temperature, moon, tides, etc. I guess all this would equate to some sort of "nervous" system, albeit rudimentary. I doubt they feel pain or pleasure at least in the sense that humans do...after all we (well, must of us) have that big head on our shoulders for a reason.
At some point on the continuum from single celled organisms to human beings, a nervous system becomes complex enough to be called a brain. I know we have some biologists among us and maybe they can enlighten us on whether there a clear indication of where nervous system/brain lies in the scope of the animal kingdom. My guess is that we typically draw the line at vertebrates/invertebrates...Phylum Chordata? Still that doesn't necessarily mean they "feel" pain the way we do, but it means they have a central nervous system and presumably some collection of cells we'd consider a brain.
I don't think a coral "thinks" about breeding...it is simply a reaction to some stimulus that engages it to do so.