Small dragons? You did not specify how big the dragons are. If they are small and move fast they would be hard to hit with a spear or arrow. A sword would be ok, or a big stick, or a tennis racquet.
Forceful blows. It is possible to apply more force if you put your body weight behind a blow. You have all of your own mass as well as that of the weapon and the force you generate. With a projectile you have only the mass of the projectile. The other thing is that if you are holding the tool you can bear down and exert continuing force; the projectile expends its force and bounces off. You could hold a spear or sword and drive it in. Likewise a heavy axe exerts more force per hit and you can deliver multiple hits once you are close.
Sawing action. If something is extremely tough, to cut it you might want to lean into it and saw at it. There is no way to do that with a projectile. Consider why saws are used to cut trees instead of flat sharp blades, or why steak knives are serrated. I am not sure a saw is considered a melee weapon but you could definitely have a serrated dragon sword, which would be fairly badass as well. The serrated sword would be a slashing weapon.
Poison delivery. Poison arrows and spears are great, but if you have a very limited amount of the poison available you might not want to risk the arrow bouncing off and failing to deliver. If you have a weapon like a thrusting spear you can be more sure of getting the poison where it is supposed to be.
Fearless. You are not afraid to close in. As usual @AlexP puts good stuff in the comments; stupidness or cluelessness are excellent reasons you are not afraid to close with the dragon. But maybe you are very quick and very cocky and you think you can move quick enough to not get hit.
If you have something with impenetrable armor then the large mass weapon is the option: an axe or mace. Plate armor is great against edges but if you hit a guy in the helmet with a 8 pound maul that energy is going somewhere. Likewise the dragon: crushing blows will hurt even through armor. The extreme case: Hercules could not hurt the Nemean Lion with any weapon and had to strangle it to death with his arm.
Sawing action. If something is extremely tough, to cut it you might want to lean into it and saw at it. There is no way to do that with a projectile. Consider why saws are used to cut trees instead of flat sharp blades, or why steak knives are serrated. I am not sure a saw is considered a melee weapon but you could definitely have a serrated dragon sword, which would be fairly badass as well. The serrated sword would be a slashing weapon.
Poison delivery. Poison arrows and spears are great, but if you have a very limited amount of the poison available you might not want to risk the arrow bouncing off and failing to deliver. If you have a weapon like a thrusting spear you can be more sure of getting the poison where it is supposed to be.
Fearless. You are not afraid to close in. As usual @AlexP puts good stuff in the comments; stupidness or cluelessness are excellent reasons you are not afraid to close with the dragon. But maybe you are very quick and very cocky and you think you can move quick enough to not get hit.