Spaces can cause word wrap that can leave a dash at the end or beginning of a line, which is not beautiful. A spaceless em dash doesn't have the wrapping issues while retaining legibility. You could argue that that's a problem with word wrap algorithms, not punctuation, but that situation is not going to change any time soon.