Check out the wikipedia article where they explain:
At the time when Viviani asserts that the experiment took place, Galileo had not yet formulated the final version of his law of free fall. He had, however, formulated an earlier version which predicted that bodies of the same material falling through the same medium would fall at the same speed.
This was contrary to what Aristotle had taught: that heavy objects fall faster than lighter ones, in direct proportion to their weight. While this story has been retold in popular accounts, there is no account by Galileo himself of such an experiment, and it is accepted by most historians that it was a thought experiment which did not actually take place.
I don't actually agree with this - its Aristotelianism that taught this; and not Aristotle; one ought to recall that Aristotle was at the very beginning of science and he had was commenting on the problem of change, and he had elucidated that change had several modes, and the predominant mode of change was motion - this was a huge advance for the time and this is why his name is justly revered; that he got details wrong is not a good reason to knock him, as physicists often do today - after all, by this basis we could say that Newtons theory of gravity was wrong in the light of Einstiens theory - but this is not the proper mode of historical assessment as it is ahistorical.
An exception is Stillman Drake, who argues that it took place, more or less as Viviani described it, as a demonstration for students.
They also remark that
Galileo arrived at his hypothesis by a famous thought experiment outlined in his book On Motion.
This experiment runs as follows: Imagine two objects, one light and one heavier than the other one, are connected to each other by a string. Drop this system of objects from the top of a tower. If we assume heavier objects do indeed fall faster than lighter ones (and conversely, lighter objects fall slower), the string will soon pull taut as the lighter object retards the fall of the heavier object. But the system considered as a whole is heavier than the heavy object alone, and therefore should fall faster. This contradiction leads one to conclude the assumption is false.
In other words, the scholarly consensus is that he came to his hypothesis/conjecture about motion through a thought experiment based on continuity and symmetry rather than through direct experiment; and nor had he directly verified it. Given this, it seems likely that the notion that Galileo actually carried out this experiment at the leaning tower of Pisa is a type of scientific myth akin to urban myths; it really ought to have died a death by now.
On a personal note, I came up with more or less the same idea just as I was finishing high school; which suggests to me other people may have had the same idea; take three balls of plasticine of the same size and hold them above the earth at the same height and at equal distances from each other - obviously they will hit the ground at the same time. Then move the middle ball a little towards the left and repeat the experiment; obviously again they will hit the ground at the same time; eventually, the middle ball will be right next to the left ball; repeating the experiment again will show that the balls again hit the surface of the earth at the same time; now squeeze the middle plasticine ball into the left - again repeating the experiment we see there is no difference; eventually the left and middle ball merge and we have a ball twice the size of the right and they both fall at the same rate.
Galileo used weights and a string attached between them.
as one can see, the argument hinges on symmetry and continuity (and the observation that how something falls does not actually vary by location).
Thinking about it, I think I used stones originally...