This is a great question.
First of all, why does a eukaryotic cell nucleus need a membrane in the first place? If we compare to a prokaryotic cell, which does not have a membrane-bound nucleus at all, we observe one major evolutionary benefit of a membrane-bound nucleus is that it allows for an additional level of regulating gene expression. Since membranes act as a barrier, eukaryotic cells can effectively control the rate at which mRNA is shipped out of the nucleus for translation in the cytoplasm (and then cotranslationally imported to the ER, if the right peptide signal is present). So whereas prokaryotes can only control the rate which DNA is transcribed by regulating activation of proteins needed for transcription/translation, etc., eukaryotic cells can regulate gene expression in multiple and complex ways owing to the compartmentalization of the nucleus with a membrane.
Now, the real question is, why two membranes? We know that the outermost membrane is connected to the endoplasmic reticulum, so the two organelles effectively share the same membrane. This makes it easy for the nucleus to get intermembrane proteins made in the rough ER - all they have to do is slide over across the shared membrane. No endocytosis is necessary, which is efficient since all the steps in endocytosis - invagination of the ER, vesicle formation, and vesicle merging with the nuclear membrane - are all heavily energy expending activities.
The additional inner membrane of the nucleus houses the DNA and the site of ribosome synthesis, called the nuclear organizing region, or NOR. Again, having another membrane compartmentalizes functions. With walls around it, the cell can maintain high concentrations of proteins and other molecules necessary for ribosome synthesis in one small section of the nucleus. Without walls, the molecules would diffuse across the larger nuclear area and more molecules would be required in order to maintain those high concentration levels.
Additionally, eukaryotic cells gain another method of control over gene expression by regulating the rate of ribosome synthesis via membrane boundaries.
So, long story short, eukaryotic cells are more complex and have more ways to regulate gene expression and maintain high concentrations of specific small molecules by compartmentalizing activities within membranes. More membranes means more control, more efficiency, and so on. Cells are the absolute coolest!