'Few' means not many (negative connotation), while 'a few' means some (positive connotation). The context 'He has many friends, but ____ good ones' sets up a contrast - he has many friends overall, but only a small number (not many) are good friends. Using 'a few' would actually be positive ('but some good ones'), which doesn't create the intended contrast.