Short Answer
It was probably legal to rant and probably illegal to shut down the person doing the ranting.
Analysis
Generally speaking, "content based" restrictions on speech are very limited, although "time, place and manner" restrictions are allowed if they are reasonable and not a backdoor way to restrict content, under the First Amendment. The "time, place and manner" exception derives from the case Cox v. New Hampshire, 312 U.S. 569 (1941) (summarize here), which held that municipalities could charge fees for parade permits even if that imposed a content neutral burden on speech in the interest of maintaining a peaceful situation in which order is maintained. Some leading cases on the subject are cited here where the professor discussing them engages in some useful analysis:
Content-neutral justifications for regulating speech are, however,
still subject to overbreadth challenges, as demonstrated by the recent
case of Watchtower Bible & Tract Society v Stratton (2002). In
Watchtower, the Court struck down on an 8 to 1 vote the ordinance of
an Ohio town that required all door-to-door advocates of causes, as
well as commercial solicitors, to obtain a permit from the mayor's
office. The town had attempted to justifiy its ordinance as a
fraud-prevention and privacy-protection measure, but Justice Stevens
wrote for the Court that the ordinance was "offensive not only to the
values protected by the First Amendment, but to the very notion of a
free society." The Court found the alleged interests in protecting
residential privacy and preventing fraud insufficient to justify such
a sweeping restriction. The Court noted that the ordinance reached
religious proselyting and anonymous political speech (where fraud is
not an issue) and that residential privacy could be adequately
protected by another Stratton law that allowed homeowners to place
themselves on a "Do Not Solicit" law and then post "no solicitation"
signs on their property. The Stratton case strongly suggests that the
Court would find a carefully drafted "Do Not Call" law applying to
telemarketers to be constitutional.
Two of our cases concern the state's interest in preventing
disturbances of the public peace that might be caused by controversial
speech. In Feiner (1951), the Court upheld the conviction of a
speaker who refused three requests from a police officer to stop
speaking after members of a street corner audience threatened to
attack the speaker. Dissenting justices saw the decision as an
outrage, suggesting that the police had an obligation to protect the
speaker and arrest those who might try to assault him. (In Forsyth
County (1992), the Court struck down an ordinance that allowed county
officials to set permit fees for rallies and parades based on how much
police protection was estimated to be required. The Court noted that
such a permit system disproportionately burdens unpopular speech
(allowing a "heckler's veto"). One wonders, after Forsyth County,
whether Feiner remains good law.)
For example, most municipalities have noise ordinances that set a decibel limit on noise for a particular time of day (usually quieter at night), and might even require a permit to use a loud speaker in a public area, on the content neutral basis of how loud the sound is (classic "time, place and manner"), rather than the content.
The legal boundaries on using a "disturbing the peace" ordinance to limit troubling content are quite strict (the classic exception being shouting "fire" in a crowded theater or otherwise inciting a riot or provoking a fight).
This particular example would implicate not only freedom of speech but also freedom of religion and so would be subject to particularly strict scrutiny to content based restrictions.
It would probably be unconstitutional to shut down the speaker because it was upsetting to young children under some more general statute or ordinance, although one can imagine circumstances where a narrowly tailored ordinance or law might be held constitutional.
For example, there are valid restrictions on sex and violence in publicly broadcast television content during hours when children typically watch television, but those restrictions do not extend to cable TV or streaming services.
Two of the leading U.S. Supreme Court cases are Ginsberg v. New York (1968), reasoning that material can be obscene as to children (“harmful to minors”) but not as to adults. Society simply doesn’t want harmful material to fall into the hands of minors. However, the government has also attempted to regulate material even beyond the expression prohibited under
a harmful-to-minors law. This is the area of indecent expression. And, FCC
v. Pacifica Foundation (1978) that the government could fine a radio station for playing a George Carlin comedic monologue containing profanity during daytime hours. But, neither of these harmful to minors cases involved prostelytizing for minority religious views, which is less content neutral than limitations on profanity which is as much about the manner of the presentation of the content as the content itself.
In any case, it is almost certain that there is no narrowly tailored statute or ordinance that actually exists in this particular situation.
Remedies
Indeed, shutting down the speaker while claiming to be an off duty police officer might very well constitute an intentional violation of civil rights of the speaker under color of state law under 42 USC Section 1983, in circumstances where clearly established first amendment law prohibits that conduct a denies the officer qualified immunity from liability.
Even if there were content neutral ordinances that prohibited this content, in this situation, the clear basis for the action was not content neutral and did not refer to any content neutral limitation such as a noise ordinance.
The damages would probably be nominal or modest, but the prevailing party would be entitled to attorneys' fees and costs and quite likely to injunctive relief against further attempts to limit speech in this manner.