No experience from mining iron?
Solution 1:
You only get experience from non repeatable processes. If you could get exp from mining iron you could just mine a block, place it back down, then mine it again for more XP. When you mine coal, redstone, diamonds, or other blocks that drop a item when you break it you can't place the original block back and keep farming the XP.
For blocks that drop blocks (like iron) you need to smelt the iron in a furnace to get the xp reward as that is the "non repeatable" step in getting the iron.
Solution 2:
Any ore that must be smelted into a bar, such as iron or gold, you get the experience when you do the smelting.