Practice what you preach is often a quote in the books and not in real life. As humans, many of us are great in advising and ordering people around us, some have an adamant attitude that comes partly from their upbringing and partly by ignorance that they are the better than the rest of the crowd. It doesn't cost much to advise and dictate but it takes a lot of maturity, courage and discipline to follow what we advise.
In the first instance, the person next to you is probably worried about catching an infection but is ignorant about his own spitting the pan in public places. If you observe closely, people who are soft natured are look docile are often spoke to rudely by others, like this co-passenger. If you have a stern body language or jokingly but clearly point out their errors they would think twice before talking to you.
In the second instance, if things don't go well, people easily forget their own contributions to it and are quick to find fault with others. Many of us often give the excuse of traffic jam, missing the bus etc when we are late to work, if we think back, most often we would have set out late from home without allowing time for delays.