There are many situations that might make it so that people would want to be transferred from one prison to another. In some cases, this would be because they are far from family members or because the only family members that could visit are sick and would only be able to visit a much closer prison. There are many things taken into account when a prisoner applies for a transfer.
Courts have to look at a prison transfer based at least partially on the benefit that it might have for the inmate. They will consider behavioral issues, medical issues, and other concerns about available programs at different prisons. In some cases, a transfer will not be granted even if a department agrees that it is for the best because there is simply not room at the desired prison.