I've noticed that you get experience orbs from mining coal, redstone and diamond. However, you do not get any from mining iron. Is there a reason behind this, or is it a bug?
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.
Any ore that must be smelted into a bar, such as iron or gold, you get the experience when you do the smelting.
The ores must be smelted. You get experience points when you get the actual resource. You do not when you get a 'needs to be refined' item.
When mining you only get exp from coal or diamonds. Otherwise you have to smelt the ores into bars to get the crafting exp.