Spheres are (homotopy) cogroups for the same reason that homotopy groups are groups. The comultiplication S^n \to S^n \vee S^n is the map that collapses the equator, the same map that is used to define composition in homotopy groups. Note that this only satisfies the cogroup axioms up to homotopy, just as composition in the homotopy group is only a group operation because you are taking homotopy classes. However, Maps(X,S^n) does not inherit a natural cogroup structure from S^n, because Maps(X,S^n \vee S^n) does not naturally map to Maps(X,S^n) \vee Maps(X,S^n). However, there is something called (stable) cohomotopy groups: these are stable homotopy classes of maps from X to S^n. This is a cohomology theory, the cohomology theory associated to the sphere spectrum. This cohomology theory is very hard to compute though; its value on a point is the stable homotopy groups of spheres!