It's almost certainly a kind of delousing spray; sterlization of incoming prisoners is common practice in most prisons, for all of the reasons you'd expect.
Although I'm not aware of confirmation from James Gunn, things like this happen in the real world all the time; Prison Legal News reports on a class action suit filed against the Cleveland House of Correction for taking similar action with prisoners (emphasis mine):
The Sixth Circuit Court of Appeals has held that a proposed class-action complaint filed on behalf of pretrial detainees at the Cleveland House of Correction, which alleged it was unreasonable for the jail to 1) spray them with delousing solution instead of allowing them to self-apply it, and 2) conduct strip searches and delousing in groups of detainees (or with one detainee spraying another), stated a cause of action.
The firehose delivery method was most likely chosen for the comedic effect. I've also seen it speculated (e.g. on the RPG.net forums) that it was a reference to The Shawshank Redemption, which features a similar scene (although much more serious, obviously).
As to why the other Guardians aren't subjected to it: they almost certainly were. G33kwatch.com reports on a "first look" event for the movie, which took place in July 2014 (two weeks before the theatrical release); they claim to have seen a montage of all the main characters being subjected to the treatment:
The group are sent to a supermax prison in space called ‘The KYLN’. When they arrive each of them are led down a hallway and Star-Lord sees a guard rummaging through his stuff and finding his walkman. The guard plays the tape inside, which is the song from the trailer, “Hooked on a Feeling”. Star-Lord gets into a fight with the guard telling him that the song is his. After zapping him repeatedly with a stun baton the song continues playing while showing a montage of everyone being sprayed with an alien delousing liquid. After they are cleaned up they put on their prison uniforms and move into General Population.
Interestingly, no other source I can find reports this quite the same way; JoBlo and GStyle Magazine also report on the preview, but only describe Quill being deloused. Regardless, as phantom42 points out in a comment on the question, Rocket appears slightly orange upon entering his cell, and there's no good reason for a prison to skip the process on the others.
The Junior Novelization doesn't provide much more detail, although it does specify that "the group" was "processed", which further indicates that the others were also sprayed (emphasis mine):
[Peter] couldn't lose Awesome Mix Tape Vol. 1. Prison didn't scare him, but that did. The group was processed, given uniforms to wear, and escorted into the yard.
Guardians of the Galaxy: The Junior Novel Chapter 4