Most likely because at some point previous to this swap was needed. Moving data into swap is a priority when free memory is low, but moving it out is not a priority when free memory is available. The justification for this is pretty sound if you think about it for a bit.
Stuff that gets swapped out in the first place is stuff that isn't being accessed much, but which cannot be released. For example, if you have a server running that isn't very active, its data might be eligible.
This implies whatever process (A) caused the need for swapping is not the process (B) who's data has been swapped. When process A ends and its memory is released, this has no effect on whats in swap. The stuff in swap stays there until it is both needed and there is enough free memory to hold.
Hence if, before process B becomes active, some other process suddenly needs some RAM, it will be available without the need to swap. If instead the seldom accessed stuff had been swapped back in as soon as RAM were available, the swapping would have to be done all over again.
This is a heuristic which matches general usage patterns. Stuff that isn't active tends to stay that way. You can tune how swapping is done, but unless you have very unusual needs there is not much point.