Because in Sweden, procedurally, you do not get charged until you are in custody. Largely because they don't want to make it a separate concern as you put it.
I'm really sad that his hasn't gone to the European Court of Human Right to decide against Sweden (or England, because it is actually England that is keeping him locked up).
Note that I do not have a high opinion of Assange, and it is quite possible that according to Swedish law he did rape those women. But he should have been entitled to a trial in absentia.
So he only has another 4 years to go