How could the Bible be used both to uphold slavery and abolish it?
This is a good question. The best way to answer this question is to realize that the Bible is a large book with lots to say on many different topics, slavery included. In light of this, it is easy to read the Bible selectively. Therefore, some have read the Bible to endorse slavery. For example, there are several places in the Bible where Paul states that slaves should obey their masters (Ephesians 5:6 and Colossians 3:22). The implication according to this interpretation is that slavery is a legitimate institution.
With that said, there are others places in the Bible where Paul states that there are no more slaves in Christ. For example, Galatians 3:28 states: "There is neither Jew nor Gentile, neither slave nor free, nor is there male and female, for you are all one in Christ Jesus."
Based on these two perspectives, what needs to be done is to understand what the Bible says from a holistic point of view. When this is done, slavery may be seen as an evil institution, which the Bible abhors. However, too many people take the biased approach and do what is expedient for themselves.