map
is to generate lazy sequence out of a sequence whereas what you need is to do certain operation (i.e swap) for each item in a sequence, hence you need to use doseq
EDIT: (updated as par @mobyte suggestion)
(let [myAtom (atom {})
a [1 2 3]
b [4 5 3]]
(doseq [[x y] (map vector a b)]
(if (== x y) (swap! myAtom assoc x y )))
(prn @myAtom))
Your first example works because you executed each expression in REPL which made the map operation to execute its lazy operations.
I have seen many people try to use map to do certain operations like this, map should only be used for one purpose i.e mapping a sequence to another sequence without any side-effect operations.