How does the thickness of a wing affect its aspect ratio?
Indeed, the aspect ratio is defined as you describe. It is a way to define how slender the wing is for a given wing area, which is the main parameter in determining how to generate enough lift to keep the aircraft aloft. An area is two-dimensional, and a broadly rectangular shape like a wing area is defined by the length and the breadth of it: span and chord. 

Aspect ratio describes the proportions of span and chord: a short stubby wing, or a long and slender one? This is one of the main parameters in how much drag the wing creates: a long slender wing minimises one particular form of aerodynamic drag, called induced drag.

 Image source

But a wing is a cantilever beam, subjected to aerodynamic lift. The lift forces bend the wing upwards, and the wing structure must produce internal forces that cancel out the aerodynamic lift. In a hollow cantilever beam like a wing, the skin mainly does that: the upper skin resists compression, and the lower skin resists tension. The further away the upper and lower skin are, the lower the stresses. A structural engineer wants to give as much distance between the plates as possible: he wants the wing to be very thick, in order for it to be light in weight.

But again aerodynamics puts a limit to this: a very thick wing would create too much form drag, so the structures people are given the maximum distance that the aerodynamics can support. Wing thickness affects aspect ratio in defining the maximum AR that can be achieved.

The wing thickness is not part of the induced drag, and does not appear in the definition of the aspect ratio. It is an important defining parameter in wing weight and other forms of drag.