Because map is already defined on a Flow and there it returns another Flow.
A StateFlow is Flow, and since we don't want to change the api of Flow, that means that map on a StateFlow must return a Flow as well.
You can create an extension method called something like mapWithState on a StateFlow to do what you want.