I’ve never heard of the short story this was based on but apparently it has a long, controversial history within the sci-fi community. The author himself hated the ending, both for its meanness and lousy engineering, which was forced upon him by John W. Campbell (a truly terrible writer and buddy of L. Ron Hubbard.)