Preface: Context matters.
There really isn't enough information in the question to provide a definitive answer. Legal answers are rarely generally applicable. Law isn't physics. You can't start from general propositions and accurately predict the result. In physics A+B = C and that is that. In law, A+ B sometimes equals C but sometimes equals D or E instead.
Legal questions don't have trans-substantive answers. In other words, the correct answer to legal questions is often highly context specific. The fact that a general principle controls in some situations does not mean that it applies in all situations.
You need to know what the contract was for and what circumstances were involved to provide an accurate answer.
The General Rule
Generally contracts only bind people who sign them or agree to them, but it is hard to know if the general rule or an exception to it applies without more context.
The rule that a contract binds only the parties who agree to it has many exceptions and there are many circumstances where it doesn't apply the way one might expect it to apply. The list of exceptions below is not comprehensive. There are also other exceptions that aren't mentioned.
For example, if property is jointly owned, typically any one spouse can lease the property or authorized repairs to it, but can't sell it.
Along the same lines, suppose that one spouse hires a lawn service for their home (which they own jointly) and the other does not sign the contract with the lawn service (suppose that it is for frivolous lawn work like fancy topiary work, rather than "necessary lawn work" to which a different rule discussed below applies) and then the lawn service is not paid. The lawn service can place a lien on the property that will burden both spouse's interest in the property, even though one of the spouse's refused to sign the agreement, and the house could be lost to a mechanic's lien foreclosure if that debt is not paid.
Normally, agreements related to children can be authorized by either parent.
Normally a loan is only binding against people who agree to pay, but not if both parties receive loans from the lenders (e.g. if there is a credit card in both spouse's names and both use it even though one doesn't sign a master agreement).
One spouse can agree to something on behalf of the other spouse if the spouse has "apparent authority" to do so, under general principles of agency. What constitutes "apparent authority" is very context specific. A power of attorney would certainly suffice, but wouldn't always be necessary.
For example, if a spouse is at home supervised a worker and agrees to an additional charge for something (e.g. authorizes a babysitter to work extra hours or authorizes a tow truck company to provide an extra charge insurance on a car not owned by the authorizing spouse), apparent authority will often be inferred from the spouse's actions even if that spouse wasn't actually authorized to agree to something, and the other spouse will be bound.
Non-Contractual Liability That Is Equivalent In Effect
There are also non-contractual theories of liability for a spouse in some cases.
For example, the necessities doctrine states that a purchase made by a member of a household for necessities (like food or utilities) is enforceable against the adults in the household even if not entered into by that person.
A related concept, which arguably is separate, is that a spouse can be responsible financially for medical services authorized by either spouse even if the other spouse didn't expressly authorize it, and so can the person to whom the medical services were provided, if different.
Similarly, under the "family car doctrine" a "head of household" can often be legally responsible for a car accident of anyone in the household who is using a "family car" without regard to who owns the car and who was driving the car.