They are programmed by other reversers to have a legal way to "crack" software.
Crackmes, Reversemes and Keygenmes have similar protection schemes and algorithms to those found in commercial protections. Also some crackmes are even harder than their commercial counterparts.
A Keygenme specifically is designed for the reverser to not only find the algorithm used in the application, but also write a small Keygen in the programming language of their choice.
Often anti-debugging and anti-disassemble routines are used to confuse debuggers or make the disassembly useless. Code-obfuscation is also used to make the reversing even harder.
But most crackmes are hard by design, not by long obfuscated code, because most reversers solve crackmes for fun. That's the reason why most reversers define rules for their crackmes.