If you have two of the same buildings, you can merge them to upgrade it:
1. Tap one of them to open the menu
2. Choose the rightmost Merge button
3. Tap another same building
4. Tap the Merge button to upgrade it