Does a bad grade in one course (with otherwise OK record) affect graduate admissions? I'm currently an M. Phil student in Math and I failed a course last semester because I was not able to hand in a home work assignment (which was worth 40% of my grade) on time (I was 30 minutes late). 

Apart from that I'd say I'm a fairly decent student, I got an upper second class honours bachelors degree, I have a B+ and A's for all my other courses in my current programme and I'm almost finished with my first paper to be published. 

I've however been deeply worried about this failure as it would reflect poorly on my transcript if I were to apply to a Ph.D or another Master's programme. 

Will my failing grade affect my chances of getting into a competitive programme or greatly lower my chances of getting a scholarship?
It's not a deal breaker. I had awful grades in many courses but I got offers with TA/RA-ship/fellowships from a couple of top 25 US PhD programs in Math. The reason, I think, was that I had very high GRE scores, I had participated in undergraduate/masters "research" projects for a few years with professors at my schools, and I had pretty good recommendations. My research statement was normal and earnest. I didn't have any extraordinary ideas nor some well defined research agenda in it. I think that, overall, the rest of my portfolio made up for my awful grades. 

In your case, it's just one course. That does not signal any systematic problem. If you feel particularly insecure, you can address it in your personal statement but don't talk about the professor in question negatively, instead you can focus on how you were tardy once but it does not reflect your work usual work ethic. I cannot speak for top 10 schools. They may have a sufficiently large pool of applicants who may beat you on every metric.

Also, Math departments at large public Universities generally need lots of bodies to TA/grade their numerous remedial and baby-calc type undergraduate courses and generally do the culling at the qualifying exam stage. You may find their standards for an incoming PhD class to be more forgiving.