How can I get rid of these two vertices without faces being deleted
Welcome to Blender Stack Exchange!

When you choose to delete vertices, it will not only delete the points themselves, but also any faces or edges that the vertices are part of. That's why part of the mesh disappears. Any face that the vertices were part of are now deleted.

Because of this, Blender has a number of dissolve options, that will delete your selection but keep everything connected.

The option in the delete menu that you'll want is dissolve edges or limited dissolve. Since two connected vertices form a edge, dissolving that edge will remove the vertices too. Limited dissolve will remove vertices, edges, and faces, but only if removing them won't change any angles in your object by a certain angle (5 degrees by default).

I highly recommend testing out the different options so you know what they each do, so that when you have a task to do, you know what tools are available to use.