Normally when a person is convicted or acquitted of a crime the double jeopardy clause prevents that person from being retired for the same crime, either in state or federal court. However there are a few exceptions where the United States Supreme Court can retry someone for a crime they were convicted or acquitted of in a lower state or federal court, this is known as the Dual sovereignty doctrine. The US Supreme Court can make an exception to the double jeopardy clause under a few specific circumstances: when there was a clear case of misconduct in the first trial, jury nullification was present in the first trial (which is when the defense presents irrelevant material designed to play on the jury's emotions and cause them to disregard the facts and evidence and render a verdict based on sympathy for the defendant or some other emotionally motivated reason) or if the sentence in the first trial was woefully inadequate and can be substantially enhanced in a federal court.
In this instance double jeopardy does not protect Officer Petro from being prosecuted for the homicide of the victim by the United States Supreme Court, after pleading guilty to it in the New York State Supreme Court, because the United States Attorney is arguing that A: New York should have prosecuted the homicide as a hate crime and B: his sentence was woefully inadequate since Officer Petro was guilty of murder in the first degree, with a hate crime attachment (a crime punishable in federal court by either life in prison without the possibility of parole or death), but was plead down to murder in the second degree, with no hate crime enhancement, and sentenced to life in prison with the possibility of parole after 25 years. The federal courts have the option of taking jurisdiction over cases where serious crimes were committed by a law enforcement officer, or where a civil rights violation occurred (a hate crime being one example) or where they can hand down a much more severe sentence than was handed down by the lower court. In this case they are able to both take the homicide case from the New York County District Attorney's office and set aside the verdict and sentence handed down in the New York State Supreme Court because all three of those apply to this case: a serious crime was committed by one or more NYPD officers, the victim was targeted because of his sexual orientation (making it a civil rights issue) and the federal court will be able to hand down a substantially enhanced sentence.