There's a lot of input in this thread, but we have no idea what the 'dangerous' fault was, or what part was replaced.
If the decision was correct, that the car was in the 'dangerous' category, then the garage was probably right to insist on repairing it. But currently we are unable to comment on that.
Most people see an MOT as a necessary evil, and a failure as a disappointment. Some blame the testing garage.
I see an MOT as a benefit. No matter how good, or not, any of us are at our vehicle checks and home maintenance, having someone independent have a good look over it, following a set procedure, is a very good thing. If they find a fault, I am grateful that it has been identified, and a little guilty that I had been driving it in that condition. I am pleased that my local garage are strict, but fair on MOTs. They charge the full price, and I happily pay that too.
An aside. I wonder what happens if a government MOT centre issues a dangerous fail. They do not do repairs, but you cannot drive the car away. Do they turn a blind eye, or keep it until a recovery vehicle turns up?