"with the/an aim to" is unnatural. We use "with the aim of verb+ing".
This place was designed with the aim of providing social opportunities.
If you want to use "to", say something like:
The aim of the design of this building was to provide social opportunities.
Student or Learner