Lol, you get confused easily.
While atmosphere is necessary, I would wager the lack of a magnetic field on the moon is why we abandoned it as a destination and place for humans to live and explore. If it had a magnetic field, then we could still live there by creating our own atmosphere inside some type of moon housing. We could have humans living there already!
The same with Mars. Instead, NASA has to decide whether to send humans there to explore further. Mars is still important as it is the planet most like Earth. I think they will, but will have to have some kind of protected space station nearby. Is that even possible? I dunno, do you?
As for James Webb telescope, we can use it to see if Mars had a magnetic field in the past and how Earth's magnetic field was in the past.
ETA: Nikola Tesla discovered Earth's magnetic field. Is that why Musk named his car after him?
The Earth is unique among the inner planets in our Solar System (Mercury, Venus, Earth and Mars) in that it has a strong magnetic field. It is this invisible field which causes the needle of a comp…
explainingscience.org
Nikola Tesla, the brilliant Serbian-American inventor and electrical engineer, revolutionized technology with his groundbreaking contributions to alternating current (AC) power systems and numerous other inventions that shaped the modern world.
www.britannica.com