so sanity check would be checking if the behavior is reasonable and rational.
I'm talking about having to put in gratuitous checks to make sure that the given data is plausible given the expectations of the business logic. My background is mainly in "legacy" applications where bad data can be a real concern. The intent is to make sure that the conditions are right to continue processing the data, with the alternative being either correcting the data or raising an error strong enough to get the bad data noticed.
The problem with "sanity" in this context has to do with social stigmas about mental illness. As someone that is mentally ill, I get it. Yup, my brain processes things incorrectly according to the world. Yup, this makes life difficult for me. But I am not "insane" despite my brain's broken data and twisted business logic.
While I am not personally offended or put off by the use of "sanity" in this way around software engineering, I agree with the general principle that judging "sanity" in code can be problematic. There are ways to express the same idea without implying judgement about mentally ill people.