Metadata editing can be a very intensive and slow process so calibre only saves the changes to the file when absolutely necessary. Most of the time that means when taking the file out of calibre.
EPUB supports changing the cover. However when you use the viewer it just opens the book within calibre. Since it's not leaving calibre the metadata in the file itself isn't updated.