A discussion on this thread relating to "how good a program" Maryland men's basketball has been led me to do a bit of searching online, and I found an interesting site called College Poll Archive. It has data on all of the AP polls for football, men's basketball and women's basketball.
One of pages on the site lists teams by the number of appearances (at any ranking) that teams have made in the AP poll. You'll primarily find teams you'd expect to find, as well as a few you might not expect. The full details are here, but I'll go ahead and post the Top 25:1. North Carolina
15. Michigan State
17. Ohio State
18. NC State
19 (t). Connecticut
19 (t). Notre Dame
25. St. John's (NY)
This is probably as good a starting point as any for a discussion of the best NCAA men's basketball programs.
As a side note, they had a page (current through the 2007-08 season) that listed the teams with the most appearances at #2 in the poll without ever reaching #1. Top of the list? Maryland, with 23 appearances at #2 (Louisville was second with 16).
So it appears that the Terps are number one at being number two without having been number one. Yay?