This is due to profile.rb's :specialized_instruction => false compile option, on line 5. If you comment it out, none of the three cases will show any calls to #==. Specialized instructions are performance-optimized during compile-time. By default, specialized instructions are enabled. In the second example, 0==1 is parsed before require "profile" is evaluated, so that #== is optimized, and not traced. The opposite is true in the first and third examples.
You can also see how 0 == 1 is compiled differently w/ or w/o specialized instructions by comparing:
If this is not a bug, I think it should be documented, either in Profile, TracePoint, or InstructionSequence. I don't think there is one canonical list of specialized instructions, but a good place to start is iseq_specialized_instruction() and iseq_compile_each()'scase NODE_MATCH.