FRANKFURT, June 23 (Reuters) - Germany's coalition government will stick to its social agenda and reconcile that with military aid to Ukraine in budget talks due to wrap up next month, Chancellor Olaf Scholz said in a television interview on Sunday.

"We will defend the welfare state and develop it further," the head of Europe's largest economy told public broadcaster ARD.

Germany's three-way coalition is in negotiations that Scholz has said will be completed by July 3, ahead of a NATO summit on July 9.

"I am confident that we will be able to get the budget on its way in July," he said during an ARD summer interview series with politicians.

The left-leaning Social Democrats (SPD), pro-business liberals (FDP) and ecologist Greens are haggling over issues such as money for welfare benefits and new housing, while adhering to self-imposed rules that limit the amount of state borrowing.

Asked whether support for Ukraine was in question given the tight domestic budget situation, Scholz said: "There is no alternative, in my view, to change any of that."

"I have always advocated prudence and that we use every opportunity to make a peaceful development possible, that does not involve Ukraine's capitulation."

Scholz also said there would be a tougher stance against people on social benefits that refused to take on work and those receiving benefits but working illegally on the side.

Allegations that their numbers are growing have been part of populists' criticism of the government.

European Parliament elections earlier this month saw the far-right Alternative for Germany (AfD) score 16% in second place behind the opposition Christian Democrats, while support for Scholz's SPD fell to 13.9%, its worst result in postwar Germany.

"We must ensure that nobody, who can work, doesn't work," Scholz said. (Reporting by Vera Eckert, editing by Susan Fenton)