Which non-parametric test should I use to compare 2 independent groups when i have several ties (Wilcoxon not good for this weird sample)? I'm doing an analysis of a master's student in which I need to compare a continuous numerical variable between two groups. The samples are independent and each group contains only three observations each. The issue is that the treatment was very efficient compared to the control, the database came a little strange.
The treatment was so efficient that the bacteria counts zeroed in the three cases that received the drug (it's an antibiotic that is being tested, which totally killed the bacteria). In one of the cases I have, for example, I have: control = c(17.38 , 17.33 , 17.16) and treatment = c(0 , 0 , 0). In the Mann-Whiney test, but these tests that use ranks do not show the presence of ties, behaving very strangely, displaying warnings of their possible not working and very well with the same p-value all the comparisons I made. Next, I thought about using the median test, which creates a 2x2 table and applies Fisher's Exact Test, but I don't know if it would be suitable.

With three observations in the control with values all about 17, and three observations in the treatment all with values of 0, I don't think a hypothesis test will tell you much.
Unless you need to conduct one for performative reasons.
In that case, one option is the Fisher-Pitman permutation test.
control = c(17.38 , 17.33 , 17.16)
treatment = c(0 , 0 , 0)

Value = c(control, treatment)
Group = factor(c(rep("Control", length(control)), rep("Treatment", length(treatment))))

library(coin)

oneway_test(Value ~ Group, distribution="exact")

   ### Exact Two-Sample Fisher-Pitman Permutation Test
   ###
   ### Z = 2.236, p-value = 0.1

As you mention, a test of the medians may also make sense.
library(coin)

median_test(Value ~ Group, distribution="exact")

   ### Exact Two-Sample Brown-Mood Median Test
   ### Z = 2.2361, p-value = 0.1

This should be similar to the chi-square test underlying Mood's median test.
chisq.test(matrix(c(0,3,3,0),nrow=2), simulate.p.value=TRUE,B=10000)

   ### Pearson's Chi-squared test with simulated p-value (based on 10000 replicates)
   ### 
   ### X-squared = 6, df = NA, p-value = 0.1056

A Wilcoxon-Mann-Whitney test would make sense, but I would use an implementation with an exact option.
library(coin)

wilcox_test(Value ~ Group, distribution="exact")

   ### Exact Wilcoxon-Mann-Whitney Test
   ###
   ### Z = 2.0868, p-value = 0.1

Finally, with the caveat that I wrote the function, you could investigate the difference in means by a simple permutation test of the values. This function simply permutes the values and determines how often this result is at least as extreme as the original difference in the means.
library(rcompanion)

percentileTest(x=control, y=treatment, test="mean", r=10000)

###           p.value
###   p-value  0.1041

