You need to use Order by to get the result in required Order try changing the Split string function like this
Try this way
CREATE FUNCTION dbo.Fnstringsplitter (@string NVARCHAR(MAX),
@delimiter VARCHAR(2))
RETURNS @result TABLE(
id INT IDENTITY(1, 1),
split_val NVARCHAR(MAX))
BEGIN
DECLARE @start INT,
@end INT
SELECT @start = 1,
@end = Charindex(@delimiter, @string)
WHILE @start < Len(@string) + 1
BEGIN
IF @end = 0
SET @end = Len(@string) + 1
INSERT INTO @result
(split_val)
VALUES (Substring(@string, @start, @end - @start))
SET @start = @end + 1
SET @end = Charindex(@delimiter, @string, @start)
END
RETURN
END
Query:
SELECT split_val
FROM dbo.Fnstringsplitter('1,3,2', ',')
ORDER BY id
Note: This is not a efficient way to split the data. But reliable in your case