Boxing dates back to the 17th century. At the time, boxers fought without gloves and util the knockout, and very often matches lasted too many hours.
Huge sums of money were wagered on these fights, and fighters were under enormous pressure to keep fighting, no matter how injured they became. This resulted in so many deaths that boxers protested, demanding some sort of rules were established to decide when the fight could be declared over. So it was agreed tha before each round, each fighter would have to come up to the "Scratch", a line scratched into the middle of the ring. I either of the two boxers couldn't stand on the line without toppling over, he was disqualified and the fight was over.
Nowadays, something that fails in some sort of quality control is still said not to come "up to scratch".