Come on man, Ace was his brother. You can't expect him not to give a shit about ace anymore just because he's dead.
People don't forget about their loved ones from the moment they die.
About otama, I think that he got attached to her because she fed him while she had nothing to eat and even fell sick because she had to drink poisoned water to calm her hunger. That and the fact that she was a friend of Ace.
It's small thing but luffy is a simple man, if he sees someone's good and that person treats him well, he becomes his friend.