Suppose Congress passed a bill written in Spanish and the President signed it. Everything about the bill and the procedures by which it was written and passed were completely normal, other than the language. (Assume everyone in Congress, as well as the President, is fluent in Spanish.) Would the fact that the law is written in a language other than English have any effect on its enforceability, other than the practical difficulties caused by many people not understanding it?
It would indeed be valid and legally enforceable. The Constitution places no limits on what languages bills must be written in. The Constitution specifically allows each house of Congress to make its own rules for how it passes bills, so, even if a house of Congress had a rule requiring its bills to be in English (which they don't, as far as I know,) they could simply change the rules and then pass the bill.
From a practical standpoint, though, enforceability would also require courts to be able to discern Congress' intent from the bill. As such, unless we're expanding the assumption to "the vast majority of the U.S., including the courts in all parts of the country, are now fluent in Spanish," then it's exceedingly unlikely that Congress actually would pass a substantive bill in a language other than English. Even without assuming all of Congress were fluent, it's possible that they could pass a resolution in Spanish as a gesture, but they would almost certainly not pass a substantive bill in Spanish (or any other language than English) due to the enforceability problems it would cause with courts (and, if relevant, regulatory agencies, etc.)
Aside from the courts needing to be able to understand the normal meanings of the words in Spanish, there would also be the problem of the complete lack of any legal history of Spanish words in U.S. law (or even in common law in general.) Much of legal interpretation is steeped in history of what particular words have meant (and/or been ruled by courts to mean) in past laws. Throwing all of that legal history out the window by switching to another language would be quite problematic when trying to craft a bill on any substantive subject matter. Suffice it to say that crafting the definitions section for such a bill would be quite a task.
So, yes, it would technically be legal and it would indeed be the law, but doing it with any substantive subject matter (without assuming that most of the population now understands Spanish) would be so problematic for enforceability in practice that they wouldn't actually consider doing it.
Under Article VI of the Constitution, treaties have the force of law, and the United States has sometimes ratified treaties in languages other than English.
For example, the treaty signed with Morocco in 1786 was originally in Arabic, translated into English, and was ratified by the Continental Congress in 1787. It was in force when the Constitution itself was ratified.
The treaty of alliance between the U.S. and France in 1778 was another example. It was presented to the Continental Congress in parallel French and English columns for ratification, but declares, “the present Treaty was originally composed and concluded in the French Language.” At that time, French was a more widely-used international language than English, and gentlemen in America were expected to know both languages. (This put George Washington in an embarrassing situation where, after he signed a document in French surrendering Fort Necessity, during the French and Indian War, he had to admit he did not understand what it said.)
As English has only become a more dominant international language since then, modern U.S. treaties are almost all in English, or at least state that the English text and the version in some other language are equally authentic.