It was Roger Corman's practice when going on location to make the most of that location by shooting a second film. This film was made because Corman was in Puerto Rico to shoot Creature from the Haunted Sea.
Screenwriter Robert Towne didn't have the completed script finished on time. Rather than paying to have both an actor and a screenwriter on location, Roger Corman saved money by drafting Towne to act in the movie as lawyer Martin Joyce (under the name Edward Wain).