This option is already available with the package pidgin-extprefs.
However, a bug seems to prevent pidgin to minimize to tray when started on login from the session startup list, as described here (including workaround): http://ubuntuforums.org/showthread.php?t=465590
I do not know if this is an Ubuntu/Gnome problem or a Pidgin problem, but it *is* a problem. The "Hide buddy list at startup" option of pidgin-extprefs works fine if I launch Pidgin from a script, but if I launch Pidgin directly from the session manager, the option is ignored.