This is a ubiquitous line that I've seen attributed to Ulysses S. Grant, Duncan Campbell Scott, John A. MacDonald and several others in relation to Indian boarding schools and residential schools, but I've never seen evidence that they actually said it or that they saw this as their goal. Who originally said this and was it ever said as anything other than a criticism of the policy of forced assimilation?
While there were likely versions of this saying bouncing around at the time, Richard Henry Pratt, a cavalry officer and superintendent of Carlisle Indian Industrial School, the flagship residential boarding school in the U.S., used the saying in an 1892 speech in Denver, Colorado. The full text of the speech can be found here.
Very briefly, persistence of indigenous peoples in the U.S. posed a significant problem to a country that demanded cultural assimilation, and access to land. Tropes like the "disappearing Indian" and the inevitably of civilization triumphing over barbarism underscored the belief that indigenous people could not survive in the "modern" United States. Pratt was riffing on the saying, possibly attributed to Theodore Roosevelt, that the only good Indians are dead, and using the residential schools as an alternative for extermination. Pratt believed by removing children from their indigenous families, and baptizing them in the sea of white culture, the residential boarding schools could extinguish indigeneity. The Indian in them would be (culturally) dead, but the child would live and be armed with the language training and skills to survive/be "useful" in the modern world. He said this with full conviction of the righteousness and goodness of his cause, and it was in no way a criticism of assimilation.
Check out this collaborative post written last year for more information and larger context to the residential schools in the US and Canada.