The Texas Penal Code specifically defines capital murder as murder which involves one or more of the following aggravating factors: murder of an on-duty officer or firefighter, in the course of committing or attempting to commit a certain felony offense, Murder for remuneration, while escaping or attempting to escape a penal institution, while incarcerated with a qualifying factor, Murder of an individual under ten years of age, or murder of a person in retaliation for, or on account of, the service or status of the other person as a judge or justice of any court
http://en.wikipedia.org/wiki/Capital_punishment_in_Texas#Capital_offenses
for example
I bet other states have similar laws. Only checked Louisiana and Texas so far