electromagnet question
A battery is not a perfect voltage source with infinite power abilities. A battery is usually an adequate voltage source for reasonable load demands placed on it. Every battery has an ESR (effective series resistance) and this can be seen to get bigger as the battery loses it energy. The ESR limits the ability to drive current and this also means it limits the current into a short circuit.

Your AA battery, your 9V source and your 12V source (without knowing the specs and presuming you wired them correctly) do not generate enough current to attract iron filings.

On the other hand your lantern battery does have the grunt to push enough current round the coils on your nail. It fried the wire because the current is too much for the wire. If you want to make an electromagnet then observe these rules: -

Force = \$\dfrac{(amps\cdot turns)^2\cdot \mu_0\cdot A}{2\cdot g^2}\$

Where 


A is cross sectional area of the nail (larger diameters make better EMs)
g is gap to your filings from the end of the nail
\$\mu_0\$ is 4\$\pi\$ x \$10^{-7}\$


Amps and turns and diameter all make a better magnet. If you double the turns the force is quadrupled. Ditto amps and diameter.