Because it’s good for you!
(Kiku wa ittoki no haji kikanu wa isshou no haji;
“To ask is a moment’s shame; to not ask is a lifetime’s shame.”)
It’s embarrassing to have to ask a question and reveal that you’re ignorant about something… but the embarrassment lasts a short time, and largely ends at the same time as you learn the answer. Remaining ignorant, on the other hand, means a lifetime of shame as one is forced to avoid or gloss over situations where missing knowledge threatens to become apparent – or where one reveals it without even realizing. When in doubt, it’s better to ask.
This saying is another pair of parallel phrases. Technically each is a noun phrase, but can function as a complete sentence if you fill in the elided copula.
We begin with the verb 聞く (kiku), “to listen” or “to ask,” in attribute form, which allows it to function as a noun. The particle は (wa) marks this noun as the topic of discussion and sets up a contrast with the second half of the saying. The comment on the topic comes in the noun 恥 (haji), “shame,” “embarrassment,” “disgrace.” This in turn is attached by the associative particle の (no) to the number-noun compound 一時 (ittoki; NOT ichiji as the characters are often read), literally “one time,” or by extension “a brief time.”
The second half repeats the verb, this time in imperfective form with the negative suffix ず (zu), which in turn is nominalized through its attributive form ぬ (nu). It repeats the particle は to emphasize contrast, and repeats ～の恥. The biggest change is that the number-noun modifying haji is 一生 (isshou), “one life” (i.e. one’s whole life).
一時 can be replaced with 一旦 (ittan), “a moment,” and/or 一生 can be replaced with 末代 (matsudai), “eternity.” The former alternate wording doesn’t really change the meaning, but the latter ups the stakes dramatically: in this context 末代 refers the soul’s continued existence in its next life even after one’s current body has died! How much better would our society be if we saw willful ignorance as a literal stain on the soul? Another valid substitution replaces 聞く with 問う (tou), which more specifically refers to asking questions.
Another comment on ittoki: apparently it used to refer to a specific span in Japanese timekeeping, about two hours in modern terms. In that light, the embarrassment of having to stick your neck out and ask a question wasn’t considered fleeting – it was simply orders of magnitude better than a lifetime of shameful ignorance.
Finally, a note on 一生: it can also refer to “the greatest [something] of one’s life,” which means that the saying could also be interpreted as saying that lacking the courage to ask questions is “the greatest shame in life.”
(“Doukyuusei no me no mae de mada mada genso to wa nani ka to iu kisoteki na koto de sae shiranai no ga baretara yappari tsurai kedo, zutto shiranai yori wa mashi ni kimatteru kara to omotte sensei ni kiite mita. Soshite igai to anshin wo oboeta. Hontou ni, kiku wa ittoki no haji dakedo kikanu wa isshou no haji da.”)
[“I knew it would be really painful to let all my classmates see that I didn’t even know something so fundamental as what an element is. But I asked anyway, because it was definitely better than never knowing. And I was actually surprisingly relieved afterwards. It’s really true that asking a question is embarrassing for a moment, but not knowing is embarrassing for a lifetime.”]