There could be several reasons. First make sure the hinges are not sprung and that the screws are fully set and tight.
If the new door is heavier than the old one, it may be that the hinges are not strong enough.
If the door swings inward, close the door with you standing inside. Look at the space between the door and frame. If it is even all way around, the doors is probably swelling. Along the top, if it's wider opposite the hinge side but parallel along the sides, the door is sagging. if it is parallel across the top but wider on the edge at the top or bottom, the frame is shifting.
A good wood sealer will prevent swelling.
If the door is sagging, install a cross brace. You can get them at the hardware store.
If the frame is shifting, it could be a structural problem with the building.