From Hash.[]=
documentation:
key should not have its value changed while it is in use as a key (an unfrozen String passed as a key will be duplicated and frozen).
Since by default, strings are not immutable in ruby, theoretically you can change them after you set them as keys in your hash. If you do that - your hash will become invalid, as it will not be able to find those keys properly.
Since string are ubiquitous and are often used by reference, this way Ruby protects its hashes from unexpected bugs, which are very hard to detect.