Here are the relevant Vinaya quotes, regarding this issue in the OP:
Should any bhikkhu report (his own) superior human state, when it is factual, to an unordained person, it is to be confessed.
A violation to be confessed, not a major violation; if the report is factual. If it is false, then it is a Pārājika (defeat).
Should any bhikkhu, without direct knowledge, claim a superior human state, a truly noble distinction of knowledge and vision, as present in himself, saying, "Thus do I know; thus do I see," such that regardless of whether or not he is cross-examined on a later occasion, he — being remorseful and desirous of purification — might say, "Friends, not knowing, I said I know; not seeing, I said I see — vainly, falsely, idly," unless it was from over-estimation, he also is defeated and no longer in affiliation.
PTS version, Volume 1, pages 151-158
The background stories to it seem logical; that if monks and nuns were allowed to broadcast their attainments, there might be disparities in dana given to monastics of various qualities and also encourage deceit in others.
Note that this is for monks and nuns, not lay people. A lay person making claims cannot be defeated (obviously) since they are not in robes, however they would be violating the 4th precept (of the 5 lay precepts) only if it is not factual.