IIRC, there were two things that were said in the episode:
1. An energy dampening field was turning off the antimatter. If you believe the TOS torpedoes used antimatter then they would've been disabled once they left the safety of the shielded firing ship.
2. Commodore Decker (on the Constellation) exchanged fire with full phasers from long range at the Doomsday Machine. Since firing at the front of the Doomsday Machine from long-range guarantees a shot going down it's throat and that the phasers were ineffective then there must have been some protective shielding preventing the phasers from damaging the interior.
So in order to get a weapon inside the Doomsday Machine you had to fly it in, past whatever was protecting the interior and then detonate. So it may not have been that obvious of a solution for one ship to figure out...