Why are lab coats required in chemical laboratories?
It is protection. It should be worn whenever you work with potentially dangerous chemicals. In German, it is even called (part of the) persönliche Schutzausrüstung, i.e. personal protective gear. Lab coats:


protect you against contamination with chemicals — acids, bases, toxic molecules and salts. They will ‘hit’ your coat and ‘stick’ to it rather than reaching your clothes. Don’t say you are careful. Your labmate may not be or an accident may happen. This is also the reason why labcoats are never allowed where food or drink are consumed.
protect you against spills of liquids. You can quickly take off a lab coat and not be contaminated by the liquid in question. This is basically an extension of the first bullet point.
protect you against fire. This might not be obvious, but lab coats are generally cotton which does not burn well. If you are wearing synthetic fibre below the lab coat, ripping that off could give you valuable seconds for not burning to death.
show other people that you are working with something potentially dangerous. Assuming you are dealing with adults that means they will know better than startle you because they can.


Everything else a lab coat supplies is basically just extension of the protection or meant to help people actually use it. Pockets: If it didn’t have any, people would keep using their trousers’ ones potentially contaminating them. Long sleeves: You arms need protection, too. Being long: so do your legs (at least partially).

And of course, it’s pretty cool if you walk in a lab coat, isn’t it? (That was my feeling at least.)