If Congress had made such a law, states would in fact be obliged to enforce it;
This is incorrect. States are not, and cannot be, obliged to enforce federal law. That would be commandeering, which SCOTUS has considered verboten. Persuaded, certainly, by e.g. tying highway funds to drinking age, but not forced to enforce it.
In the case of the immigration law from Texas, there are a few things to consider.
First is Texas's argument on "invasion" under Article IV §4 cl.2., which on its face only imposes a duty on the federal government, and it's highly unlikely the border crisis satisfies the criteria for an invasion. It is true that under the Tenth Amendment, powers not delegated by the Constitution to Congress nor prohibited by the same to the states would be reserved by the states or the people. Congress has been delegated power to create a uniform rule of naturalization, as well as power to make all laws necessary and proper for the execution of the enumerated powers. "Uniform" would by definition make the power to legislate laws on naturalization exclusive, though the border crisis is not a question of naturalization
per se. Necessary and Proper would also require some further exclusivity regarding the border and ports of entry. Additionally, the Commerce Clause (and its pre-emption) imposes additional limitation on state action, and the Compact Clause outright strips state power on various border questions that are inherently agreements or contracts with other states or a foreign power (e.g. Mexico). The Compact Clause is conditioned on there not being an invasion (or an imminent danger thereof), but again, the border crisis is unlikely to be considered as such.
That brings us to the second point. The current relevant precedent is Arizona et al. v. United States from 2012. It operates on pre-emption. Is there any leeway or loophole for Texas to implement its law?
What are the components of the law? There's a criminal component (10 Penal Code Chapter 51), enforcement and deportation components (1 Code of Criminal Procedure Chapter 5B), and an indemnity component (Title 5 Civil Practice and Remedies Code Chapter 117). I will ignore the indemnity and enforcement components; the former is irrelevant, and the latter is just a prohibition of enforcement.
The deportation component would run afoul of the Compact Clause, at minimum, and it's unlikely to be saved by an "invasion" argument. It would also likely be pre-empted by federal law, either by conflict or occupation of the field. Arizona et al. v. United States supports an analogous argument.
The criminal component criminalizes illegal entry (§51.02), illegal reentry (§51.03), and refusal to comply with an order to return to foreign nation (§51.04). Criminalizing refusal to comply is likely to be pre-empted per the previous paragraph.
Parts of §51.02 and §51.03
might be constitutional on their faces. A substantial difference from Arizona et al. v. United States was that Arizona SB1070 §3 was regulating the federal alien registration by criminalizing the failure to register. The federal alien registration framework was considered by SCOTUS to be pervasive enough to trigger field pre-emption. On the other hand, §51.02 and §51.03 at their cores don't touch any federal regulatory framework, though §51.02 does create affirmative defenses based on some, and §51.03 uses some federal action to pin down a timeline. The first comparison that comes to mind would be the state regulation of NFA weapons. Disregarding the Second Amendment for a moment, several states have banned NFA weapons and criminalized their ownership without running into pre-emption issues. So, Texas may even have written §51.02 and §51.03 with Arizona et al. v. United States in mind.
However, it is also possible for those sections to be conflict pre-empted by existing federal legislation on illegal entry. Yet, given the dual sovereign doctrine, I'd say its a toss up on conflict pre-emption. At the very least, if the federal government provides the state with no leeway on the time of deportation, then conflict pre-emption would require the state sentence to end the moment federal officers come to pick up the deportee. Given that there is already interaction between deportation and various other state crimes, however, I imagine it won't be too much of a problem.
Regardless, SCOTUS has merely judged on the injunction and not the merits of the Texas law.