It appears that the website you're attempting to access does not utilize the basic authentication protocol.
Instead, it employs OAuth. To download the file, you will need to carry out an authenticated download.
Refer to the websites workflow provided for Authentication:
This process requires you to obtain an authentication token from the Earthdata Login service, which you then use to configure the HTTP request header for the download.
The following MATLAB code snippet illustrates the steps for this authenticated download:
tokenService = 'https://urs.earthdata.nasa.gov/api/users/find_or_create_token';
username = 'yourUsername';
password = 'yourpassword';
credentials = matlab.net.base64encode([username ':' password]);
headers = struct('name', 'Authorization', 'value', ['Basic ' credentials]);
options = weboptions('HeaderFields', {headers.name, headers.value});
tokenResponse = webwrite(tokenService, options);
token = tokenResponse.access_token;
fileHeaders = struct('name', 'Authorization', 'value', ['Bearer ' token]);
downloadOptions = weboptions('HeaderFields', {fileHeaders.name, fileHeaders.value}, 'Timeout', Inf);
fileurl = 'https://cddis.nasa.gov/archive/gnss/data/daily/2021/143/21h/MAR700SWE_R_20211430000_01D_SN.rnx.gz';
filename = 'RINEXFile.rnx.gz';
websave(filename, fileurl, downloadOptions);
ans = '/users/mss.system.qkQ0UA/RINEXFile.rnx.gz'
You can refer to the following MathWorks Documentation for weboptions and websave:
Hope it helps
Thanks
Chetan