In general, React does not care what characters are inside the string, it does not need to check. React uses the keys when checking uniqueness in the virtual DOM and the keys do not appear in the resulting HTML (any more). Therefore no HTML rules, especially not the ones defined for id apply here.
Why identifiers in HTML do not allow spaces? The reason is probably because they are used in CSS as #myIdentifier and spaces there would make the meaning ambigious.