It's a bit more complicated than your attempt. Better to make the character math active rather than active tout court, so no category code is changed and \widecomma can also be used in the argument to another command.
The instruction \let\comma=, doesn't work, mainly because you want to save the math code of the comma.
\documentclass{article}
% save the math code of the comma
\mathchardef\normalcomma=\mathcode, % define a suitable meaning for the active comma \newcommand{\activatewidecomma}{% \begingroup\lccode~=, \lowercase{\endgroup\def~}{{\normalcomma}\ }% } % in the scope of \widecomma the space after the comma will be wider \newcommand{\widecomma}[1]{% \begingroup % set up the wanted meaning and make the comma math active \activatewidecomma \mathcode,="8000
#1%
\endgroup
}
\begin{document}
$\widecomma{a,b}$ (wide)
$a,b$ (normal)
\end{document}

However, as pointed out in comments, commas in subscripts or superscripts should not be affected by this behavior. We can fix the issue in the following way.
\documentclass{article}
% save the math code of the comma
\mathchardef\normalcomma=\mathcode, % define a suitable meaning for the active comma \newcommand{\activatewidecomma}{% \begingroup\lccode~=, \lowercase{\endgroup\let~}\makewidecomma } % in the scope of \widecomma the space after the comma will be wider \newcommand{\widecomma}[1]{% \begingroup % set up the wanted meaning and make the comma math active \activatewidecomma \mathcode,="8000
#1%
\endgroup
}
\newcommand{\makewidecomma}{%
{\normalcomma}% comma as an ordinary symbol
\nonscript\mskip 6mu plus 3mu minus 2mu % space only in text or display style
}
\begin{document}
$\widecomma{a,b}$ (wide)
$a,b$ (normal)
$\widecomma{a,H^{0,0}}$ (wide)
$a,H^{0,0}$ (normal)
\end{document}

expl3and split a comma list with,~as separator. – Gaussler Sep 26 '21 at 16:31\foreachfromtikz, but it requires special treatment for the first or last entry. – Tianren Liu Sep 26 '21 at 18:19a{,}~bbe more appropriate? – daleif Sep 27 '21 at 11:38\widecomma{a,H^{0,0}}, you probably don’t want the changed spacing to affect the comma in the superscript (unless I’ve misunderstood something). – Gaussler Sep 27 '21 at 13:17f(x,y), perhaps you don’t want the spacing to apply to this comma. Whatever – it’s good to see different solutions that behave slightly differently.;-)– Gaussler Sep 27 '21 at 13:32