Functionalists argue that all parts of a society serve a purpose and are necessary for each society to function. This is true for both crime and deviance of all kinds.
To a functionalist, crime serves the purpose of showing the law-abiding what the boundaries of a society are and what is deserving of punishment. Crime also provides employment and purpose for those dedicated to stopping, capturing, punishing, and rehabilitating its perpetrators, namely police, judges, lawyers, prison guards, social workers, and probation and parole officers. Those functions and boundaries can change over time. For example, we no longer punish those who blaspheme against religion. We do punish marital rape, though two generations ago, that was not considered a crime in the eyes of the law.
To a functionalist, deviants serve a similar purpose, though the deviants' punishment may not be by legal means but through social pressure and condemnation. Again, what is regarded as an acceptable boundary can change over time. Homosexual behavior used to be regarded as deviance, and it was even criminalized only two generations ago. Today there are openly gay public figures, even politicians, and gay marriage is legal.