MARION, Ill. (AP) _ The nation's oldest war veteran, a man described by his daughter as a straight-laced person who never smoked or drank, has died at the age of 107, the Veterans Administration said Friday.

Jasper Garrison, who served in the Spanish-American War beginning in 1898, died Thursday of heart failure at the VA hospital here, said Frances Gilliam, a hospital spokeswoman.

''Somebody asked him how he lived so long,'' Garrison's daughter, Lena Hays said. ''He said, 'God forgot about me.'''

Only three other veterans of the Spanish-American War are still alive, VA spokesman Chuck Lucas said in confirming Garrison was the nation's oldest living veteran.

''He was a very straight-laced person,'' said Mrs. Hays, of nearby Christoper, who asked that her age not be disclosed. ''He never drank, he never smoked.

''He never had any fun doing anything,'' she joked. ''He never went to a show in his life. My father led a clean life.

''He got so much adoration, people from all over came and they wanted to shake his hand,'' she said. ''He kinda liked it, you know. He really basked in their affection.

Born May 1, 1880, in Wayne County, Garrison enlisted in the 4th Illinois Volunteer Army in June 1898. He arrived in Havana, Cuba, that August and spent nine months on the island during the Spanish-American War.

Later, he returned to Illinois, where he and his wife, who died at age 83 in 1962, had four children. He lived with Mrs. Hays until he moved into the VA nursing home in Marion in February 1986.

Replacing Garrison as the country's oldest living veteran is 102-year-old S. Leroy Mendel, a Fort Worth, Texas, native now residing in Galva, Ill., Lucas said.

''There's a sadness to it,'' Mendel said of Garrison's death. ''I hate to see other people die like that. I'm just gonna live on, that's all.''

The other two living Spanish-American War veterans are 102-year-old John T. Fitzgerald of Toms River, N.J., and 101-year-old Nathan E. Cook, of Tempe, Ariz., Lucas said in a telephone interview from his Washington office.

Fitzgerald is three months younger than Mendel.

Indiana's last Spanish-American War veteran, Jesse A. Jackson, died Tuesday at age 105.

On his birthday last year, Garrison received a congratulatory letter from President Reagan.

The president wrote: ''Your long and experienced life reminds all Americans how much we owe to those who have answered our country's call in time of crisis. Your service in the Spanish-American War has won you a permanent place in our hearts.''

Mrs. Gilliam said although Garrison's health had deteriorated in the past several weeks, he remained mentally alert.

''He always got real up for his birthday because we made a big deal of it,'' she said. ''He smiled a lot. He laughed. He was very happy.

She said he liked to talk about ''being a Republican, Teddy Roosevelt and being a Baptist.''

''Everyone kept asking him about longevity,'' Mrs. Gilliam said. ''His stock answer was 'good food.' He liked bacon and eggs.''

Services will be Sunday.

In addition to his daughter, Garrison is survived by three sons.