A function is a set -- a set with additional structure. A function $f: X \to Y$ can be thought of as a subset of $X \times Y$, i.e., as a set $S$ of pairs $(x,y)$ such that $f(x)=y$. However, it's not just any old set. To qualify as a function, it has to have the additional property that $f(x)$ has a single value. Put another way, the set $S$ cannot contain two elements $(x,y)$, $(x,y')$ such that $y \ne y'$: a function is a set $S$ where that never happens.
The same applies here. The transition function is a set (a subset of $Q \times \Sigma \times Q$), but a set with some additional properties/restrictions that must hold for this to qualify as a DFA.
So, it's defined as a function to emphasize the additional requirement that for each state $q$ and each symbol $s$, there is a single state $q'$ that you go to, i.e., a single transition out of $q$ on symbol $s$.
If there were multiple possible states you could go to, from $q$ when receiving symbol $s$, then it wouldn't be a deterministic finite automaton -- it'd be a non-deterministic finite automaton.