In any spiritual practice the Sadhana (the effort) and the Siddhis (the fruits of that effort) are better to be kept secret. This is the very basic of any spiritual Sadhana. Same is the case with Yoga.
Hatha Yoga Pradipika, Chapter 1, Verse 11 says:
Hathavidya param gopya yogina siddhim-ichchata |
gupta nirvirya tu prakashita ||
Hatha yoga is the greatest secret of the yogis who wish to attain
perfection (siddhi). Indeed, to be fruitful, it must be kept secret;
revealed it becomes powerless.
On this verse there is a long commentary by Swami Muktibodhananda. I am producing here some parts from it which talk about why Yogis keep Siddhis secret and why it is necessary to do so.
This sloka is typical of any yogic shastra expounding higher
knowledge, i.e. the science should be kept to oneself. Whatever a
sadhaka gains or achieves during the period of sadhana should be a
private affair. This may seem a little out of context as the book
itself appears to be disclosing the secrets of the practices, but in
fact, when you learn under the guidance of a guru, you will find that
Swatmarama has only stated the bare essentials as guidelines for the
practice of asana etc., so that the science of hatha yoga will be
preserved for humanity.
Gorakhnath used to tell his disciples that hatha yoga is the science
of the subtle body. It is the means by which the body’s energy can be
controlled. He said that hatha is the means of controlling the two
main energy channels of the positive/negative currents.
The positive/negative nature of energy exists in every part of our
being. Hatha yoga not only brings a balance in the energy, but also in
the duality of the mind, and between the lower nature and the higher
mind, between the individual soul and the universal spirit. It
involves yourself and the atma, so why bring anyone else into the
picture? In the Shiva Samhita it says that the practitioner should
keep his practice secret “just as a virtuous wife keeps her intimate
relations between herself and her husband quiet.” This develops the
love between husband and wife. Similarly, if you have any respect
for your own beloved, the pure atma, whatever experience and power you
are bestowed with is your own affair and has to be cultivated
This is a purely logical and scientific process. When you have a small
light burning in a room at night, the whole room is illumined. If you
take your little light outside into the vast, open space, the light is
engulfed by the night and absorbed in the darkness. The same
principle applies to the power gained through your sadhana. The power
may enlighten your own consciousness, but displayed and dissipated in
the magnitude of the outside world, it loses strength
Keeping sadhana and siddhis under cover has a powerful psychological
effect. If you talk about and display your attainments, the sense of
‘I’ or ego becomes very acute. I have achieved, I had this experience,
or I can do this. If you want to experience cosmic consciousness, ego
or ahamkara is the greatest barrier. Siddhis never last long, they are
impermanent. After a certain stage of evolution they disappear. If you
associate yourself with the feeling that ‘I’ have perfected this and
that, you will expect yourself to be able to perform a great feat and
so will others. You will be living to meet the expectations of others,
otherwise they will not think that you are great. One day when the
siddhi leaves you, how are you going to cope with the situation? In
spiritual life it is very important to keep ego under control. Most of
the great saints and siddhas who had powers rarely displayed them.
Only the people who lived very close to them knew their greatness.
Many siddhas who did display their powers were persecuted, e.g.,
Christ. Therefore, for your own good and for the good of others it is
said, as a warning rather than mere advice, that sadhana and siddhis
are to be kept secret.
We have verse 9 from Chapter 3 (from the same text) too, which asks for the Siddhis to be kept secret.
These must remain secret just like precious stones, and not be talked
about to anyone, just as one does not tell others about his intimate
relations with his wife.
And, on this verse we have the following commentary:
We are repeatedly reminded that neither the practices, the siddhis, not the sadhana can be divulged to anyone. It is the guru’s decision
who should be given the knowledge, and it can only be gained through
experience. There is no merit in trying to share one’s spiritual
experiences with another.
So, while it might not be a sin, a Yogi has good reasons in favor of not displaying his Siddhis to others.