Vayakhel (37:5) says that B'tzal'el built the aron and put its staves into the rings on its sides.
P'kude (40:20) says that Moshe put together the mishkan and put the staves on the aron.
A couple of possibilities:
Meshech Chochmah writes (paragraph beginning וע"ד המושכל) that the staves had to always remain with the Aron in order to demonstrate that the Aron "carried its bearers"; removing them when it was at rest and attaching them only for transit would falsely imply that they were actually needed in order to carry it. This page expands on this idea to point out that the order in 40:20 is significant: first the luchos had to be placed in the Aron (to "activate" its power to carry itself and its bearers), and only then could the staves be attached to it. This would seem to fit with my first answer above: Betzalel put in the staves and then took them out, and Moshe again attached them after he put the luchos inside.
On the other hand, I see where Meshech Chochmah also says (paragraph beginning ויקח) that the staves were at the sides of the Aron when it was in transit, but that they "placed them atop the sides of the Aron, making them lie across the top of the Aron" when they set up the Mishkan. (Which, I guess, means that he holds that the mitzvah to "not remove the staves from the Aron" means that they should always be somewhere nearby, but not that they have to remain in the rings.) He uses this to explain the apparent contradiction between the two verses: Betzalel placed the staves into the rings, and Moshe removed them and laid them atop the Aron.
Oops, I missed that Alex added this answer above, but I'll keep it here for the comments.
The Meshech Chochma answers that Betzalel placed the staves in the rings on the side of the Aron. This was its mobile positioning. When Moshe set the Aron in place, he set the rings and the staves within on the top edges of the aron's walls. This was its resting position.