Race and ethnicity are variables that cannot be "controlled" in experiments, since it is not possible for the researcher to assign or change this characteristic of the study participant.$^\dagger$ For this reason, causal inference relating to race and ethnicity cannot generally rely on randomised controlled trials, and must instead fall back on uncontrolled observational studies. As with other uncontrolled studies on any other topic, this comes with all the regular drawbacks and caveats on causal interpretation of results, including the possibility that there may be omitted "lurking variables" that affect analysis. As a general principle, causal inference from uncontrolled studies is not reliable, and tends to be reasonable only in cases where the predictor in question is shown to have a statistical relationship conditional on a wide array of covariates, and tends to retain its predictive ability under variations in covariates that are not themselves intermediate causes.
Many studies in the social sciences include race/ethnicity as covariates, and the goal is to filter out these variables to find some other causal or statistical relationship. There may be some studies where race/ethnicity is of direct interest as a predictor, and in this case the researcher needs to be careful to distinguish predictive effects from causal effects, as in any uncontrolled observational study. There is certainly no scientific problem with including race/ethnicity as variables in social science studies; the problems, if any, arise in regard to interpretation of results. There is a good discussion of the causal interpretation of race variables in VanderWeele and Robinson (2014).
For the most part, all of this is just a matter of applying general statistical principles to a particular set of variables. However, one issue that arises specifically in regard to causal inference regarding race and ethnicity is competing theories of whether any causality is direct (i.e., genetic/hereditary) or indirect through a mediator variable (i.e., due to discrimination). This aspect of the problem has been discussed at length by the economist Thomas Sowell in a series of books discussing statistical disparities among racial groups (see esp., Sowell 1975, Sowell 2013, Sowell 2018). Sowell notes that historically, there was an excessive tendency to ascribe all racial disparities to genetic causes in the nineteenth and early twentieth centuries, and since the late twentieth century there is now an excessive tendency to ascribe all racial disparities to discrimination. Both of these constitute a failure to properly apply statistical reasoning relating to causality, and both tend to occur due to a conflation of correlation and cause. In any case, if you have not already read these works, they may give you a better understanding of the difficulties that arise in making causal inferences from statistical disparities among racial and ethnic groups.
It is difficult to answer your specific question without seeing a particular example of the kind of inference that concerns you. There are a wide variety of cases where social science researchers "use race for causal inference" and the validity would depend on the nature of the data and the resulting inference. (It is not even clear from that framing of the question whether race is the predictor of interest or just a covariate.)
$^\dagger$ Note that there are some randomised experiments where the appearance of race is controlled via some experimental mechanism. For example, many studies on ethnic discrimination in employment use randomised 'correspondence tests' where the researchers control (and randomise) the markers of race and ethnicity in submitted job applications (see e.g., Zschirnt and Ruedin 2015).