The alphabetic acrostic, already in practice in the Bible (e.g. Psalms 119, Proverbs ch. 31 etc.), was originally incorporated as a mnemonic. As the eminent scholar Ezra Fleisher observed (see Schirman's Toldot Ha'siraHa'shira Ha'ivrit Be'farad Ha'notzrit U'be-drom Tzarfat pg. 673) it was used primarily in religious-themed poetry.