Nonvolatile memory has advantages, but also disadvantages.
In a computer that would have only non-volatile memory it would be difficult to ensure that things that must be secret remain secret.
Various events like power failures or software bugs could prevent the erasure of the secrets when they are no longer required.
Total memory encryption, like first introduced in server CPUs by AMD, and then followed by Intel, could solve this problem, but even that depends on the CPU having internal memory that is volatile, so this allows only the reduction of the amount of volatile memory that is needed, not its complete elimination.