Why is polymer B more dense than polymer A?
First polymerisation proceeds through free radical mechanism, which may cause intermediate radicals to abstract H from other parts of growing chain, thus creating new branches in the process.
Refer Wikipedia for detailed mechanism.

On the other hand, second polymerisation proceeds through condensation reaction, where no such thing is possible (condensation can occur only at terminals). 

Furthermore, the chains of B interact through H-bonding, which is much stronger than van der Waal interaction of polymer A. This causes chains to come closer and increases the overall density of polymer.