In the Numerical Discourses (Anguttara Nikaya) of the Pali Canon, when speaking to the monk Ananda, Buddha is reported to have said:
Anguttara Nikaya - Book of the Eights, 51
"If, Ānanda, women had not obtained the going forth from the household life into homelessness in the Dhamma and discipline proclaimed by the Tathāgata, the spiritual life would have been of long duration; the good Dhamma would have stood firm even for a thousand years. However, Ānanda, because women have gone forth from the household life into homelessness in the Dhamma and discipline proclaimed by the Tathāgata, now the spiritual life will not be of long duration; the good Dhamma will last only five hundred years.
"Just as, Ānanda, prowling burglars easily assail those families that have many women and few men, so in whatever Dhamma and discipline women obtain the going forth from the household life into homelessness, that spiritual life does not last long.
"Just as, Ānanda, when a field of hill rice has ripened, if the bleaching disease attacks it, that field of hill rice does not last long, so in whatever Dhamma and discipline women obtain the going forth from the household life into homelessness, that spiritual life does not last long.
"Just as, Ānanda, when a field of sugar cane has ripened, if the rusting disease attacks it, that field of sugar cane does not last long, so in whatever Dhamma and discipline women obtain the going forth from the household life into homelessness, that spiritual life does not last long.
This passage is also found in the Khandhaka (Chapters) of the Vinaya Pitaka:
Khandhaka - Cullavaga 10
"If, Ananda, women had not obtained the going forth from home into homelessness in the dhamma and discipline proclaimed by the Truth-finder, the Brahma-faring, Ananda, would have lasted long, true dhamma would have endured for a thousand years. But since, Ananda, women have gone forth... in the dhamma and discipline proclaimed by the Truthfinder, now, Ananda, the Brahma-faring will not last long, true dhamma will endure only for five hundred years.
"Even, Ananda, as those households which have many women and few men easily fall a prey to robbers, to pot-thieves, even so, Ananda in whatever dhamma and discipline women obtain the going forth from home into homelessness, that Brahma-faring will not last long.
"Even, Ananda, as when the disease known as mildew attacks a whole field of rice that field of rice does not last long, even so, Ananda, in whatever dhamma and discipline women obtain the going forth... that Brahma-faring will not last long.
"Even, Ananda, as when the disease known as red rust attacks a whole field of sugar-cane, that field of sugar-cane does not last long, even so, Ananda, in whatever dhamma and discipline women obtain the going forth... that Brahma-faring will not last long.
The above can be framed in different ways, however, what cannot be reasonably denied is that he is putting forth a negative view of female monks/nuns (Bhikkhunis), wherein their existence is responsible for the potential dissolution of good teaching at twice the rate it would have dissolved otherwise. That is, he appears to be ascribing a theological deficiency to women on the basis of their gender.
Additionally, in the Anguttara Nikaya, and elsewhere in the Pali Canon, Buddha is reported to have said the following:
Anguttara Nikaya - Book of the Ones, 279-283
279 "It is impossible and inconceivable, bhikkhus, that a woman could be an arahant who is a perfectly enlightened Buddha...
280 That a woman could be a wheel-turning monarch...
281 That a woman could occupy the position of Sakka...
282 That a woman could occupy the position of Māra...
283 That a woman could occupy the position of Brahmā; there is no such possibility. But it is possible that a man could occupy the position of Brahmā; there is such a possibility."
Majjhima Nikaya - Bahudhātuka Sutta
15 "(A person possessing right view) understands: 'It is impossible, it cannot happen that a woman could be an Accomplished One, a Fully Enlightened One - there is no such possibility.' And he understands: 'It is possible that a man might be an Accomplished One, a Fully Enlightened One - there is such a possibility.'
He understands: 'It is impossible, it cannot happen that a woman could be a Wheel-turning Monarch... that a woman could occupy the position of Sakka... that a woman could occupy the position of Māra... that a woman could occupy the position of Brahmā - there is no such possibility.'
And he understands: 'It is possible that a man might be a Wheel-turning Monarch... that a man might occupy the position of Sakka... that a man might occupy the position of Māra... that a man might occupy the position of Brahmā - there is such a possibility.'
Anguttara Nikaya - Book of the Twos, 61
"Bhikkhus, women die unsatisfied and discontent in two things. What two? Sexual intercourse and giving birth. Women die unsatisfied and discontent in these two things."
Anguttara Nikaya - Book of the Fours, 80
On one occasion the Blessed One was dwelling at Kosambī in Ghosita's Park. Then the Venerable Ānanda approached the Blessed One, paid homage to him, sat down to one side, and said:
"Bhante, why is it that women do not sit in council, or engage in business, or go to Kamboja?"
"Ānanda, women are prone to anger; women are envious; women are miserly; women are unwise. This is why women do not sit in council, engage in business, or go to Kamboja."
Anguttara Nikaya - Book of the Fives, 55
55 "Bhikkhus, while walking, a woman obsesses the mind of a man; while standing... while sitting... while lying down... while laughing... while speaking... while singing... while crying a woman obsesses the mind of a man. When swollen, too, a woman obsesses the mind of a man. Even when dead, a woman obsesses the mind of a man. If, bhikkhus, one could rightly say of anything: 'Entirely a snare of Māra,' it is precisely of women that one could say this."
Anguttara Nikaya - Book of the Fives, 229-230
229 "Bhikkhus, there are these five dangers in a black snake. What five? It is impure, foul-smelling, frightening, dangerous, and it betrays friends. These are the five dangers in a black snake. So too, there are these five dangers in women. What five? They are impure, foul-smelling, frightening, dangerous, and they betray friends. These are the five dangers in women."
230 "Bhikkhus, there are these five dangers in a black snake. What five? It is wrathful, hostile, of virulent venom, double-tongued, and it betrays friends. These are the five dangers in a black snake. So too, there are these five dangers in women. What five? They are wrathful, hostile, of virulent venom, double-tongued, and they betray friends.
"Bhikkhus, this is how women are of virulent venom: for the most part they have strong lust. This is how women are double-tongued: for the most part they utter divisive speech. This is how women betray friends: for the most part they are adulterous. These are the five dangers in women."
If Buddha said these things, then it seems that he held a generally negative, disparaging view of women. After he began his religious life, Buddha himself was a celibate monk, who required his full-time disciples to be celibate as well. Therefore, women to him apparently seemed like a chief temptation, and it is obvious that he viewed them primarily through that lens, which apparently led to some resentment.
If, on the other hand, these sayings were invented by early the followers of Buddha, then those followers saw no problem in adding to what their master was supposed to have said, even if he did not say it, and also held a generally negative, disparaging view of women.