According to Carbon Trust, real Christmas trees are better for the environment than artificial ones.
Real trees absorb carbon from the atmosphere & emit oxygen while they are growing. Artificial Christmas trees are made from plastic (mostly PVC film), which is produced from carbon intensive oil. The subsequent manufacturing process of the tree also has high emissions.
Real trees are biodegradable. Artificial trees are usually made of non-recyclable materials, giving us synthetic waste to dispose of.
Buying a locally grown tree reduces emissions from transport. On the other hand, driving far to get one or buying one grown far away, will increase its emissions. Although artificial trees are usually shipped from China, ocean shipping makes the transport efficient. However, they are then transported to shops & homes.
A 2 metre artificial tree has a carbon footprint of around 40kg CO2e. For a 2 metre tall real tree, the carbon footprint is 16kg CO2e if it ends up in landfill to produce methane, which is a highly potent greenhouse gas. Instead, if it is burnt, carbon dioxide that it stored up when it was growing is released so there's no net increase, but the carbon is released immediately, which is not ideal. Having it chipped to spread on the garden (see RecycleNow for the many local authorities that provide this service) significantly reduces the carbon footprint and contributes to building of soil carbon.
Christmas trees are usually not harvested from wild forests, but grown as part of well managed forests or farms. In fact, the Christmas tree market gives an economical reason to maintain these farms. A 2 metre tree is estimated to be grown for 10-12 years & provides shelter for birds & wildlife when it is growing. When they are cut while leaving roots in the ground, that enables soil carbon storage. Having said that, there have been illegal logging practices & dangerous working conditions associated with Christmas tree farming. Buying Forest Stewardship Council (FSC) trees is a better choice to avoid these issues & their trees are grown minimising the use of pesticides.
There are now options to rent a living Christmas tree. But the best option is a potted tree which can be replanted and re-used year after year, and will reduce issues like water & pesticide use & transport emissions.
If you already have an artificial tree, you can minimise its environmental impact by continuing to use it for as long as possible, at least 10 years to keep its environmental impact lower than that of a real tree. If you keep it for longer, even better.