B/c often times it's not an error. Cases such as undefining method before redefining new one to suppress warning message of overriden method. Or different versions of a library might get used where one has such method and another does not.
If we need to remove a method from a class/module that may or may not have the method defined, it's less optimal. We either have do something like:
if instance_methods(false).include?(:foo)
undef_method(:foo)
end
Or,
begin
undef_method(:foo)
rescue NameError
end
Both of which entail more overhead and considerations than is really necessary.
On the other hand, if it did not raise an error and returned true/false instead, then it is easy enough for us to handle the error if it truly matters.
success = undef_method(:foo)
raise NameError, "undefined method foo' for class
#{self}'" unless success
#undef_method is not something that's used very frequently, so I think code improvements for these cases is worth it.