I think this can't be done, when this is the only information you've got. The relation between the values of the parameters, is their position in their list. There is no option to relate and/or preserve these positions in SQL.
What influence do you have on creating the sql-statement?
If you can iterate over the lists in code and dynamically create the sql, you could come to a solution like this:
SELECT * FROM Gecoserv
WHERE typeOfEcosystem = 'Freshwater' AND service = 'Habitat'
UNION
SELECT * FROM Gecoserv
WHERE typeOfEcosystem = 'Freshwater' AND service = 'Food'
UNION
...
For an example of how to parameterize this, have a look at this answer.
An alternative: splitting strings
Your main problem is to preserve the "rank"/"position" of the parameters in their lists. This can be done, by replacing your lists by strings and break them up.
I used this example of a splitting a string in sql.
The resulting query (made with this Fiddle) then looks like:
DECLARE
@ecoSystems varchar(100) = 'Freshwater,Saltwater,Dunes',
@services varchar(100) = 'Habitat,Food,Recreation',
@separator char(1) = ','
SELECT
[g].[id],
[g].[typeOfEcoSystem],
[g].[service]
FROM [dbo].[Split](@separator, @ecoSystems) [e]
INNER JOIN [dbo].[Split](@separator, @services) [s]
ON [e].[position] = [s].[position]
INNER JOIN [Gecoserv] [g]
ON [e].[part] = [g].[typeOfEcoSystem]
AND [s].[part] = [g].[service]
ORDER BY [id] ASC
Will this work for your scenario? (Answer: yes, almost...)
And finally without a function
DECLARE
@ecoSystems varchar(100) = 'Freshwater,Saltwater,Dunes',
@services varchar(100) = 'Habitat,Food,Recreation',
@separator char(1) = ',';
WITH [EcoSystemsAndServices]([posE], [startE], [endE], [posS], [startS], [endS])
AS
(
SELECT
1,
1,
CHARINDEX(@separator, @ecoSystems),
1,
1,
CHARINDEX(@separator, @services)
UNION ALL
SELECT
[posE] + 1,
[endE] + 1,
CHARINDEX(@separator, @ecoSystems, [endE] + 1),
[posS] + 1,
[endS] + 1,
CHARINDEX(@separator, @services, [endS] + 1)
FROM [EcoSystemsAndServices]
WHERE [endE] > 0
)
SELECT
[g].[id],
[g].[typeOfEcoSystem],
[g].[service]
FROM [Gecoserv] [g]
INNER JOIN [EcoSystemsAndServices] [ess]
ON [g].[typeOfEcoSystem] = SUBSTRING(@ecoSystems,
[startE],
CASE WHEN [endE] > 0 THEN [endE] - [startE] ELSE 100 END)
AND [g].[service] = SUBSTRING(@services,
[startS],
CASE WHEN [endS] > 0 THEN [endS] - [startS] ELSE 100 END)
ORDER BY [id] ASC