I heard it was one of the monk rules. What sutta says monks can’t show their powers to lay people? The Buddha showed his psychic powers to many lay people so why can’t monks?
Perhaps you have confused with this rule from the Bhikkhu Patimokkha:
Should any bhikkhu report (his own) superior human state to an unordained person, when it is factual, it is to be confessed. - Pācittiya 8
This rule is more about attainments (e.g. jhana, stream entry etc.) rather than about psychic powers.
It's right, good householder, that a Bhikkhu would do something like this - in showing his powers ('let them/him see my power') - isn't given by the Buddha to do so, and is breaking a rule with it. (mentioned as confused here already, but right: Pācittiya 8, as the 'smallest' transgression)
If mention over-worldly powers, yet not having such, it can even touch a crown rule, downfall rule, meaning no more Bhikkhu (yet not if simply over-estimating ones gains). If having, telling, showing, it's a break of the main rules Bhikkus use to cite all 14/15 days.
Although there are many instances found in the Suttas where Bhikkhus deliberately, even on request by lay-people, showed miracles and higher powers (thinking on Ven. Moggallāna, the foremost skilled in it, and praised for it by the Buddha), it seems that the Buddha later formulated this rule, some say maybe correct "he didn't trust his monks in this regard, and sure a corrupt instance (where such was made for gain or favor) gave reason to take care here.
This being one reason: using it not to inspire Faith and cut down pride (like for example the Uruvela-miracles, as maybe the most excessive sample, the Buddha made use of such)
Another, very important: if a monk does not really know the right time for a good use, even if well meant, most people are strong attached to such, would not be much attracted by the Dhamma and seek for such powers, or people able to do, as their refuge, cutting them off from Dhamma.
For the actor of such, there is huge danger to get attached to such skill, likewise mistakenly taking it as refuge.
Such is actually very common, such bad ways, even corrupt and as lies, if thinking on those providing spells, water cleaning, chanting for expelling, ... and goes up till higher powers, aside of what's called 'animal trade'.
It's, how ever, not to blame if Monks use there skills to turn others toward the Dhamma, path, yet not 'showing', letting know... how ever, sensitive (starting usually with Stream-enter) people might get aware.
Since people of this days would not even see miracles as such, would at large doubt all even if confronted, there is also less use of it in a 'god-less' society, under materialists and marxists. So one might need to go for a land of miracles to get such things known, loses doubts in regard of such.
(and as someone here as usual is up speading doubt with strawmans, although knowing it clear by himself, in saying 'we aren't sure that he did, which sutta says...': many, many Suttas, not to speak about Vinaya, commentaries..., provide that the Sublime Buddha used them often, showed them at proper occasions)
[Note that this 'miracle' isn't given for stacks, exchange, other world-binding trades, but for increase of Saddha and toward vimutti from this wheel]