It feels like a waste to memorize Keats or Cavafy when I can memorize Torah; however, I learned in yeshiva that one may not memorize psukim. What are the sources for this?
The Gemara in Gittin 60b says
דברים שבכתב אי אתה רשאי לאומרן על פה
Matters that were written you may not express them orally.
This is codified in Shulchan Aruch O.C. 49:1.
However, this rule only applies to reciting it orally (and even that is subject to much debate. See the commentators there. There's also a nice Wikipedia article as well as numerous other articles available online.) Memorizing it is not a problem and virtually all of the Gedolim throughout history had vast swaths of Tanach, if not the whole thing, committed to memory. See for example Megilla 18b:
שאני רבי מאיר דמיקיים ביה (משלי ד, כה) ועפעפיך יישירו נגדך... ואפילו הכי מיושרין הן אצל ר' מאיר
Rabbi Meir is different, as in him is fulfilled the verse: “And let your eyelids look straight before you” (Proverbs 4:25)... they remain exact [meyusharin] in the memory of Rabbi Meir, since he knows them all by heart.