Database Default Locations doesn't persist
1) Make sure the account running the SQLservice should have the required rights on the directory you are wishing to change:

2) Also, you can give a try with below T-SQL

You can also do the same with T-SQL and here is the T-SQL code to do the same.

/* I am trying to change to D drive in below example*/

USE [master]
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultData', REG_SZ, N'D:\DATA'
GO
EXEC xp_instance_regwrite N'HKEY_LOCAL_MACHINE', N'Software\Microsoft\MSSQLServer\MSSQLServer', N'DefaultLog', REG_SZ, N'D:\DATA'
GO 



Most important:-After Changing the Default Locations


You must stop and start the SQL Server service to complete the change