It is true that nearly all arteries carry oxygenated blood and nearly all veins carry de-oxygenated blood, but that is not what defines them. Arteries are blood vessels that carry blood _away_ from the heart, and veins carry blood _towards_ the heart. If you look at the situation in that light, the naming makes sense: the pulmonary artery is carrying de-oxygenated blood _away_ from the heart to the lungs, and the pulmonary vein is carrying the _re_ -oxygenated blood back to the heart, to be pumped through the rest of the body.