Psychology was separated from the subfield of philosophy known by the same name largely by the work of https://en.wikipedia.org/wiki/Wilhelm_Wundt, who first began laboratory experiments aimed specifically at analyzing the relationship between thought and behavior.
He was himself more properly still situated in the philosophical field of rational psychology, and theories very similar to his are still current within philosophy although they have little effect on modern psychology, for example the https://en.wikipedia.org/wiki/Language_of_thought_hypothesis still promulgated by https://en.wikipedia.org/wiki/Jerry_Fodor is very like Wundt's notion of how consciousness guided thought.
But he was convinced to look into the physiological considerations around psychology by things like optical illusions and other gaps between what we think we do or perceive and what we observably do, or can be proven to be shown. The first major work in the field per se may be his work "Principles of Physiological Psychology".
His students, and the American school he inspired, founded by https://en.wikipedia.org/wiki/William_James, sought a reasonable separation from psychology that left most of it within philosophy.
Psychology cannot be blamed for the concepts of mental illness, or for presumptions about the regularity of human behavior. Psychiatry already existed as a branch of Medicine and Sociology had already fledged itself from philosophy as a descriptive science in the work of https://en.wikipedia.org/wiki/%C3%89mile_Durkheim and other related schools. We cannot even be held accountable for Freud, who was a physician and not a psychologist. The resulting psychoanalytic theories remain properly within medicine or philosophy and generally do not integrate well with theories of psychology proper.
The parts of psychology that venture into these areas: Clinical and Social Psychology are still very underdeveloped and tentative compared to the parts of the discipline that lie closer to neurology or to animal behaviorism, despite attracting a lot of attention and many students. And, in contrast to the accusatory way you frame the question, we admit as much. We realize the proposed theories are too weak to hold themselves up as a physical or chemical theory might, and rely upon raw statistical procedures more intensively than most sciences with a better theoretical basis.