Adding lemon juice helps increase the acidity of the tomatoes, which is crucial for safe canning. It ensures that the canned tomatoes have a low enough pH to prevent the growth of harmful bacteria.