This is probably because static bodies do not collide, so there are no contacts between them until one becomes dynamic. Unfortunately it takes one time step for a contact to be established, and in that time step gravity also has a chance to act.
You might be able to avoid this by making the gravity scale of the dynamic body zero for the first step, but I think a better way would be to call Refilter on the fixtures of the dynamic body before stepping.
for (b2Fixture* f = body->GetFixtureList(); f; f = f->GetNext())
f->Refilter();
(I haven't actually tried this myself, but I think that's what this Refilter function is for.)