When you plant a new tree, the root system takes time to spread and attach to the soil in which it is planted. Until a newly planted tree's roots establish, the tree doesn't have much support from the bottom, meaning it may lean. If left to grow this way, the tree's roots establish where they are and the tree will grow at an angle. You can straighten a leaning tree if you want the tree to grow straight up in your landscape.
Hammer stakes into the ground at roughly 1-foot intervals all around the tree. Place rubber tubes over lengths of wire long enough to wrap around the tree and reach the stakes. Wrap the wires around the tree so that the tubes cover the parts of the wires that touch the tree. Wind the ends of the wires that you wrapped around the tree to the stakes until the wires are secure.
Dig around the root ball of the leaning tree to loosen it from the ground before attempting to move it. This Old House recommends measuring the width of the tree's trunk to get the approximate diameter and then digging a hole that is 10 times the diameter of the tree. So if the tree is 10 inches across, dig a hole with a 100-inch diameter at the base. This Old House also recommends a depth for the hole of 2 feet.
Loosen the wires on the stakes on the side of the tree that the tree leans toward to provide 5 to 6 inches of slack in the wires on that side. Make sure the tree is well-supported from the other side before loosening the wires or the tree may topple over.
Unwind the wires from the stakes on the opposite side of the tree. Use the wires to gently pull the tree toward you until it stands straight. If the tree is heavy, you may need assistants.
Provide more slack on the side of the tree toward which the tree leans if you pull the wires on that side taut but the tree still isn't standing upright. Again, make sure the tree is well-staked on the opposite side or that the other people working with you have a tight hold on the tree before loosening the wire.
Continue to pull the tree until it stands straight. Once you have the tree straightened, pull all the wires around the tree until they are taut and wind them onto the stakes to hold the tree upright.
Return the soil around the roots of the tree and flatten the soil with the shovel to firm it in place. Leave the stakes and wires in place around the tree for 6 to 8 weeks before removal. If the tree starts to lean again after you remove the stakes and wires, put them back into place for another few weeks until the tree stands upright without support.