Since "hope" and "expect" both translate as esperar, how would you say something like "It was better than I expected, but not as good as I had hoped" in Spanish?
It's true that both
expect can be translated as
esperar, but they can have also other translations...
In most sentences you will only want to use one of the meanings, and it'll be quite clear which one you're meaning...
In this case, as you want to use both meanings, you'd better use synonyms, something like:
Fue mejor de lo que pensaba / suponía / preveía / figuraba / imaginaba, pero no tan bien como deseaba / quería / me gustaría / me hubiera gustado.
hope, as you say, means a wishful expectation, so you can most of the times translate it by
I would nominalize either "expect" or "hope"; the former goes to expectativa, the latter to esperanza (context dependent). So:
Rebasó mis expectativas, pero no mis esperanzas.
Or with some freedom:
Rebasó mis expectativas, pero fue menos de lo que deseaba.
Fue más de lo que esperaba, pero me decepcionó.