Identity values are not guaranteed to be contiguous: if you delete rows, then the identity value assigned to that row is not "recycled" later, so you get "gaps" in the values. That isn't a fault, it's by design so that if other tables (or other rows) reference the deleted row's identity value they aren't "attached" to a random new row when it is inserted.
Identity values are supposed to be unique, nothing else. If you want contiguous numbers, then use
ROW_NUMBER (Transact-SQL) - SQL Server | Microsoft Learn[
^] - but remember that the values will not necessarily be the same if you run the code twice as other users could change your data between runs.
You should never try to manually force Identity values to be contiguous: it isn't what they are there for and can corrupt your entire DB if you aren't very, very careful!