The screenshots indicate which product you are using, but it is always good to state the product (ArcGIS Desktop/ArcMap, ArcGIS Pro) and version. This is especially important with Python-related questions because ArcGIS Desktop/ArcMap uses the now-retired Python 2.x while ArcGIS Pro uses Python 3.x.
The reason the code is not working is that !WellID!
isn't being expanded to the actual value, it is being inserted as literal text. There are multiple ways to do string formatting in Python, more in Python 3.x now than what existed in Python 2.x at the end. For Python 2.x, I suggest using the string format method with ArcGIS Field Calculator. From 5. Built-in Types -- Python 2.7.18 documentation:
str.format(*args, **kwargs)
Perform a string formatting operation. The string on which this method
is called can contain literal text or replacement fields delimited by
braces {}. Each replacement field contains either the numeric index of
a positional argument, or the name of a keyword argument. Returns a
copy of the string where each replacement field is replaced with the
string value of the corresponding argument.
When using with Field Calculator, it would look like:
arcpy.CalculateField_management(
"TX_WW_Final2021",
"URL",
"https://www3.twdb.texas.gov/apps/waterdatainteractive//GetReports.aspx?Num=({})&Type=SDR-Well".format(!WellID!)
)