The rules describe two ways of freeing an ally
Assuming it was a giant spider's "Web" ability, its description says:
As an action, the restrained target can make a DC 12 Strength check, bursting the webbing on a success. The webbing can also be attacked and destroyed (AC 10; hp 5; vulnerability to fire damage; immunity to bludgeoning, poison, and psychic damage).
Only the restrained creature can make the Strength check to escape, but an ally can attack the web and destroy it; the attacker needs hit against AC 10 and deal at least 5 points of damage, freeing the restrained creature in the process. I think it is the closest RAW resolution to the "I want to free my comrade from this web by force" action, since the web presumably is destroyed in the process.
Another way is to help an ally with their Strength check. You take the Help action in this case, giving your ally advantage on the check. Unfortunately, this still requires an ally to spend their action on their turn.
A DM is free to invent a third one
As a DM you don't have to follow written rules as strict as possible. 5e is more like a toolbox you use, than a rigid set of rules you have to obey, so it does not describe every possible action and resolution. Instead, the PHB assumes the DM will choose an appropriate mechanics, see the "Improvising an Action" sidebar (PHB, page 193):
When you describe an action not detailed elsewhere in the rules, the DM tells you whether that action is possible and what kind of roll you need to make, if any, to determine success or failure.
That was exactly what you did! Your ruling was good enough — it sets a cost and gives an expected result. It is perfectly normal not to look up for a specific rule every time and came with an ad-hoc ruling, speeding up the game process.