Rastafarians in the Federal prison system are allowed to keep their dreadlocks. When we visited our relative at the Federal prison in Miami FL, I saw several with VERY long dreadlocks in the visiting room.
In fact, while Federal prisoners are often kept in state or county facilities while awaiting trials (if said state or county facility is closer to a Federal courthouse than Federal facilities, the Feds contract with the local prisons to house their prisoners), if the prison system has this restriction regarding Rastafarian hair, or that of any other religious group, the Feds will not house them in the state or local facility.
This is a situation peculiar to the Virginia prison system (and any other state systems that might have the same punitive regulations).
There is no reason for dreadlocks to be "dirty", as the hair can be washed in its matted state quite well.
I don't know whether the ACLU has ever involved itself with this question, but the Rastafarians are no different than the Sikhs who also do not ever cut their hair (although theirs is kept wrapped up in a turban), and some other sects of various religions.