He bit her to take the venom out of her arm. When James bit her, he of course left venom in her blood and Bella started to turn into a vampire. All of the others knew this, but Carlisle knew a way to stop the change and that way was to bite Bella on the arm and suck the venom out. Edward was reluctant at first because he may give in to the delicious taste of Bella's blood, but Carlisle eventually convinced him or perhaps Edward convinced himself as well and he bit her and got it over with.
In Twilight Edward bites Bella's hand in the fight scene at the ballet studio to suck the venom out because James bit her hand and Edward doesn't want Bella to turn into a vampire.